User Tools

Site Tools


user-guide:export-as-lib

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
user-guide:export-as-lib [2025/04/03 12:09] gaetanuser-guide:export-as-lib [2025/05/27 00:25] (current) barley1965
Line 1: Line 1:
 ====== Project as a Module Library ====== ====== Project as a Module Library ======
  
-Project can be exported as a library usable from other projects. The exported library makes all types (classes, modules, ...) and resources (images, shaders, ...) available for import.+A project can be exported as a library usable from other projects. The exported library makes all types (classes, modules, ...) and resources (images, shaders, ...) available for import.
  
 These libraries are called module lib. These libraries are called module lib.
Line 9: Line 9:
 ===== Structure ===== ===== Structure =====
  
-Module lib follow the structure of [[:dev-guide:creating-own-plugin|GroIMP plugins]]. Thus, how the lib is integrated is described in the ''plugin.xml'' file, automatically created when exported.+Module lib follows the structure of [[:dev-guide:creating-own-plugin|GroIMP plugins]]. Thus, the way the lib is integrated is described in the ''plugin.xml'' file, automatically created when exported.
  
  
Line 23: Line 23:
 ==== Package name ==== ==== Package name ====
  
-By default, .rgg types are compiled without a package. It makes them all visible from the same pool. However, for ensuring a uniqueness when importing module library, a package name is required during the export. GroIMP will use the given package name as default package during the compilation. +By default, .rgg types are compiled without a package. It makes them all visible from the same pool. However, to ensure uniqueness when importing module library, a package name is required during the export. GroIMP will use the given package name as default package during the compilation. 
  
-Thus, if the project contains type with named package, they will not be affected by the package name provided.+Thus, if the project contains types with the named package, they will not be affected by the package name provided.
  
-The package name must follow java's specification on package name.+The package name must follow java's specification on package names.
 ==== Reference wrapper ==== ==== Reference wrapper ====
  
-GroIMP implicitly wrap all references call in the project to be exported as module library to make them use the resources form the library. +GroIMP implicitly wraps all references call in the project to be exported as module library to make them use the resources from the library. 
  
-Indeed, if a project contains a resource with the name "shaderleaf". When exported, the module that use ''setShader(shader("shaderleaf"))'', needs to point as the resource from the module lib. And not a possible "shaderleaf" in a newly opened project. +Suppose we have a project that contains a resource with the name "shaderleaf". When exported, the module that uses ''setShader(shader("shaderleaf"))'', needs to point at the resource from the module lib, and not at a possible "shaderleaf" in a newly opened project. 
  
 The wrappers force the references to point at ''plg:pkg.Plugin:"shaderleaf"'' The wrappers force the references to point at ''plg:pkg.Plugin:"shaderleaf"''
user-guide/export-as-lib.txt · Last modified: 2025/05/27 00:25 by barley1965