3DSlicer开发之路——Extensions(六)

What is an extension description file ?

An extension description file is a text file with s4ext extension allowing to specify metadata associated with an extension.(所谓extension description file其实质就是一个以s4ext为扩展名的文本文件,用来指定与对应extension相关的一些元数据

  • A metadata is specified using a keyword followed by at least one spaces and the associated value.
  • Multiline value are not supported.
  • Empty line are ignored
  • Line starting with a # will be considered as comment.

This file is generated by the build system in the extension build tree.(这个文件是由build系统生成在 extension build tree中的,在extension build tree目录中) It can also be generated by the ExtensionWizard using the extension metadata reported in the extension CMakeLists.txt.

Note that the Extension manager ignores many fields of the extension description file and instead uses information specified in CMakeLists.txt. Therefore, when making any changes to the extension description, it has to be done in the CMakeLists.txt file as well.

For the superbuild-based extensions, it is critical that the build_subdirectory is initialized to the inner build location in s4ext. The value of this variable in CMakeLists.txt is not used in all places by the dashboard scripts.

The following code block illustrates how comments, metadata and associated value can be specified:

# This is a comment
metadataname This is the value associated with 'metadataname'

# This is an other comment
anothermetadata This is the value associated with 'anothermetadata'

 

来自 <https://www.slicer.org/wiki/Documentation/Nightly/Developers/Extensions/DescriptionFile>

Supported metadata

Name

Description

Mandatory

scm

Source code management system: git or svn

      

scmurl

Read-only url used to checkout the extension source code

      

svnusername

Allow to specify username associated with svn checkout

 

svnpassword

Allow to specify password associated with svn checkout

 

scmrevision

Revision allowing to checkout the expected source code

 

depends

List of extensions required to build this extension. Specify "NA" if there are no dependency.

Extension names should be separated by a single space. For example: extensionA extensionB

 

build_subdirectory

Name of the inner build directory in case of superbuild based extension. Default to .

 

homepage

Url of the web page describing the extension. See note [1] reported below.

 

contributors

Extension contributor specified as 

Firstname1 Lastname1 ([SubOrg1, ]Org1), Firstname2 Lastname2 ([SubOrg2, ]Org2)

 

category

Extension category

      

iconurl

Url to an icon (png, size 128x128 pixels). See note [1] reported below.

 

description

One line describing what is the purpose of the extension

 

screenshoturls

Space separated list of urls to images. See note [1] reported below.

 

enabled

1 or 0 - Specify if the extension should be enabled after its installation. Default is 1

 

[1] Parameter like &foo=bar are not supported. Use a url shortener.

Partially supported metadata

Name

Description

status

Give people an idea what to expect from this code

 

来自 <https://www.slicer.org/wiki/Documentation/Nightly/Developers/Extensions/DescriptionFile>

实例:

#
# First token of each non-comment line is the keyword and the rest of the line
# (including spaces) is the value.
# - the value can be blank
#

# This is source code manager (i.e. svn)
scm git
scmurl git://github.com/ljzhu/FastGrowCut.git
scmrevision 2eac2c1

# list dependencies
# - These should be names of other modules that have .s4ext files
# - The dependencies will be built first
depends NA

# Inner build directory (default is ".")
build_subdirectory .

# homepage
homepage  https://www.slicer.org/slicerWiki/index.php/Documentation/4.3/Modules/FastGrowCut

# Firstname1 Lastname1 ([SubOrg1, ]Org1), Firstname2 Lastname2 ([SubOrg2, ]Org2)
# For example: Jane Roe (Superware), John Doe (Lab1, Nowhere), Joe Bloggs (Noware)
contributors Liangjia Zhu, Ivan Kolesov,  Allen Tannenbaum (Stony Brook University), Yi Gao, (UAB), and Ron Kikinis (BWH) 

# Match category in the xml description of the module (where it shows up in Modules menu)
category Segmentation

# url to icon (png, size 128x128 pixels)
iconurl https://www.slicer.org/slicerWiki/images/d/d9/FastGrowCutEffect.png

# Give people an idea what to expect from this code
#  - Is it just a test or something you stand behind?
status Beta

# One line stating what the module does
description This is a fast implementation of the GrowCut method that supports multi-label segmetnations

# Space separated list of urls
screenshoturls https://www.slicer.org/slicerWiki/index.php/File:FastGrowCutScreenShot.png

# 0 or 1: Define if the extension should be enabled after its installation.
enabled 1

 

原文地址:https://www.cnblogs.com/oneDongHua/p/14264080.html