Spotfire Developer Documentation

Package description file

You must provide a package description file (.pkdesc) written in an xml format. You can specify many of the command line parameters in the .pkdesc file.

For command line parameters that you specify in the .pkdesc file, you do not need to specify the parameter on the command line. Any parameters specified in the .pkdesc file are appended to the command line arguments. If you specify a parameter in both the .pkdesc file and on the command line, then the command line specification takes precedence.

Here is an example demonstrating a .pkdesc file.

 <?xml version="1.0" encoding="utf-8"?>
<!-- A package description for a Spotfire Web Client Package that includes 
       all possible elements and attributes. -->
<!-- The following attributes can be specified. -->
<!-- SchemaVersion: Required. Shall be 2.0. -->
<!-- Name: Required. The name of the package. -->
<!-- Version: Required. The version number of the package. Must contain 4 numbers separated by dots. -->
<!-- SeriesId: Required. A GUID that uniquely identifies the package. -->
<!-- IntendedClient: Optional.  -->
<!--   One of the following: 
           "any" -> works in any client type,  
           "Professional" -> works in Spotfire Analyst only,  
           "Web" -> works in Spotfire web clients only.  
         The Default is "professional". -->
<!-- IntendedPlatform: Optional.  -->
<!--   One of the following: 
           "WINDOWS" -> the package is targeted for 64-bit windows,  
           "LINUX" -> the package is targeted for 64-bit linux and will only be downloaded to a computer running 64-bit linux.
           "UNIVERSAL" -> the package is targeted for any platform. 
         The Default is "WINDOWS". 
         Note that this can be overridden on the command line when invoking PackageBuilder-Console. -->
<!-- TargetFramework: Optional.  -->
<!--   One of the following: 
           NETFRAMEWORK -> The package is targeted for .NETFramework. This also implies that IntendedPlatform is one of the WINDOWS alternatives.
           NETCORE -> The package is targeted for .NETCore (.NET 6 or higher). Currently this implies that IntendedPlatform is LINUX, but in some future also WINDOWS could be supported.
           ANY -> The package is targeted for any platform.
       The default is "NETFRAMEWORK".
         Note that this can be overridden on the command line when invoking PackageBuilder-Console. -->
<!-- WebPlayerContentFolder: Optional. Web clients only. 
       The relative folder in the web client where the unpacked files are put.  
       Do not use this unless necessary. -->
​
<PackageDescription xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  SchemaVersion="2.0" Name="An example package description" Version="1.10.23.44"
  SeriesId="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" IntendedClient="Web" IntendedPlatform="WINDOWS" TargetFramework="NETFRAMEWORK" WebPlayerContentFolder="root">
​
  <!-- AlternativeId: Optional. An element for a different combination of TargetFramework and IntendedPlatform. 
       The intention with this element is to be able to have one generic pkdesc file that can build a package for both Windows/NetFramework and Linux/NetCore
       and to deploy these packages to the same deployment area on a Spotfire Server-->
  <!-- The following attributes can be specified for an AlternativeId element. -->
  <!-- SeriesId: Required. The GUID that should be used for the package defined by the combination of IntendedPlatform and TargetFramework specified for the element. -->
  <!-- Name: Optional. The alternative name of the package. If not specified, the package will have the same name as the default name. -->
  <!-- IntendedPlatform: Required. The IntendedPlatform for the package with the alternative id. This must currently be different from the TargetFramework specified in the PackageDescription element. -->
  <!-- TargetFramework: Optional. The TargetFramework for the package with the alternative id. This is currently not necessary to specify since WINDOWS implies NETFRAMEWORK and LINUX implies NETCORE. -->
  <AlternativeId SeriesId="yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy" Name="Third Party Products NET Core" TargetFramework="NETCORE" IntendedPlatform="LINUX" />
​
  <!-- A File element that refers to an file with or without compatibility information specified. -->
  <!-- The following attributes can be specified for a File element. -->
  <!-- SourceFile: Required. The path and name of a source file to be included in the package. -->
  <!-- TargetFilename: Required. The relative path and name for the file in runtime. -->
  <!-- Type: Required. 
       One of the following: 
         "Assembly" -> a file that is a .NET assembly to be validated against the other files.  
         "File"-> a file that is just copied to the package.
         "ReferencedFile" -> an assembly that is referenced by some other assemblies in the package 
                             but that is not intended to be included in the package.
                             This applies typically to assemblies that in runtime are installed 
                             in the GAC but not on the build server.
                             A ReferencedFile is NOT validated to be part of a deployment area on a Spotfire Server.
                             NOTE: "ReferencedFile" was added in Spotfire 4.0.
         "ReferencedFileInOtherPackage" -> an assembly that is referenced by some other assemblies in the package 
                                           but that is not intended to be included in the package.
                                           The difference between this and "ReferencedFile" is that a validation
                                           is performed by Spotfire Server that the file actually is part of some other package.
                                           NOTE: "ReferencedFileInOtherPackage" was added in Spotfire 12.0. -->
  <!-- Bitness: Optional. Set the value to 32 to indicate that an assembly is compiled for x86. -->
  <!-- IntendedPlatform: Optional. This file will only be included if the IntendedPlatform for the package matches. -->
  <!-- TargetFramework: Optional. This file will only be included if the TargetFramework for the package matches. -->
  <File SourceFile="folder1/Assembly1.dll" TargetFilename="root/bin/Assembly1.dll" Type="Assembly" IntendedPlatform="WINDOWS" TargetFramework="NETFRAMEWORK">
​
    <!-- Compatibility element. Optional. -->
    <!-- The following attributes must be specified for a Compatibility element. -->
    <!-- Min-version: Required. 
            The minimum version of the client that this assembly is compatible with. Default is 0.0.0.0. -->
    <!-- Max-version: Required. 
            The maximum version of the client that this assembly is compatible with. Default is #.#.*.*. -->
    <!-- Note: 
             '#' specifies that it is compatible with the corresponding digit in the version number. 
             '*' means any number from 0 to 65535 -->
​
    <Compatibility Min-version="1.0.0.0" Max-version="#.#.*.*" />
  </File>
​
  <!-- A File element that refers to an assembly without compatibility information specified. -->
  <File SourceFile="folder2/Assembly2.dll" TargetFilename="root/bin/Assembly2.dll" Type="Assembly" />
​
  <!-- A File element that refers to an x86-assembly without compatibility information specified. -->
  <!-- Note. Spotfire Web Player is not supported on 32-bit Windows, but this is added as an illustration to how to specify using 32-bit assemblies -->
  <File SourceFile="folder2/Assembly_32.dll" TargetFilename="Assembly_32.dll" Type="Assembly" Bitness="32"/>
​
  <!-- A File element that is not an assembly, just a copied file. -->
  <File SourceFile="folder2/SingleFile.dll" TargetFilename="root/bin/SingleFile.dll" Type="File" />
​
  <!-- A File element that refers to an assembly that only should be included when a LINUX package is built. -->
  <File SourceFile="runtimes/linux/lib/net6.0/PlatformSpecificAssembly1.dll" TargetFilename="PlatformSpecificAssembly1.dll" Type="Assembly" TargetFramework="LINUX"/>
​
  <!-- A File element that refers to an assembly that only should be included when a WINDOWS package is built. -->
  <File SourceFile="runtimes/win/lib/net6.0/PlatformSpecificAssembly1.dll" TargetFilename="PlatformSpecificAssembly1.dll" Type="Assembly" TargetFramework="WINDOWS"/>
​
  <!-- A ReferencedFile element that is stored in the GAC in runtime but not necessarily installed .
       on the build server.
       Note: SourceFile can be specified with or without any file extension.
       TargetFilename must be specified but is ignored. -->
  <File SourceFile="ReferencedFile1" TargetFilename="" Type="ReferencedFile" />
​
  <!-- A ReferencedFileInOtherPackage element that has to be part of some other package when validating a deployment area on a Spotfire Server. 
       Note: SourceFile can be specified with or without any file extension.
       TargetFilename must be specified but is ignored. -->
  <File SourceFile="ReferencedFileInOtherPackage1" TargetFilename="" Type="ReferencedFileInOtherPackage" />
​
  <!-- A File element that is not an assembly and that contains a resource identifier. -->
  <File SourceFile="folder2/FileThatCanBeReferenced.txt" TargetFilename="root/bin/FileThatCanBeReferenced.txt" Type="File">
​
    <!-- ResourceIndentifier element. Optional. -->
    <!-- A ResourceIndentifier is a named resource that is possible to reference through the ModulesService API. -->
    <!-- The following attributes can be specified for a ResourceIdentifier element. -->
    <!-- Name: Required. 
       The name of the resource that will be used when referencing it through the ModulesService API. -->
    <!-- Culture: Optional. 
       The culture for the resource. This is mainly used for localized help files. -->
​
    <ResourceIdentifier Name="file.that.can.be.referenced.txt" Culture="sv-SE"/>
  </File>
​
  <!-- A Folder element with potential sub-folders to include. -->
  <!-- The following attributes must be specified for a Folder element. -->
  <!-- SourceFolder: Required. 
       Path to a folder from where all files except any exceptions specified by "ExcludePrefix" are copied.  
       This also includes all sub folders. -->
  <!-- TargetFolder: Required. 
       The relative path to the the folder where the files shall reside in runtime. -->
​
  <Folder SourceFolder="folder3" TargetFolder="root">
​
    <!-- ExcludePrefix element. Optional. 
       A string specifying that files and folders beginning with this prefix are excluded from the copy.-->
    <!-- In this example, the bin folder is excluded. -->
    <ExcludePrefix>bin</ExcludePrefix>
​
    <!--  A file to exclude. -->
    <ExcludePrefix>Example web.config</ExcludePrefix>
​
    <!-- All files and folders beginning with '_' is excluded. -->
    <ExcludePrefix>_</ExcludePrefix>
  </Folder>
​
  <!-- An optional file declaration that has a target filename called 'module.xml' means that a copy 
       of the module definition is stored in the source file. 
       This file is created for the specified IntendedPlatform="WINDOWS".
       Note that any settings in the original target file are overwritten when the package is built. 
       -->
  <File SourceFile="windows_module/Example.module.xml" TargetFilename="module.xml" Type="File" IntendedPlatform="WINDOWS"/>
​
  <!-- An optional file declaration that has a target filename called 'module.xml' means that a copy 
       of the module definition is stored in the source file. 
       This file is created for the specified IntendedPlatform="LINUX".
       Note that any settings in the original target file are overwritten when the package is built. 
       -->
  <File SourceFile="linux_module/Example.module.xml" TargetFilename="module.xml" Type="File" IntendedPlatform="LINUX"/>
​
</PackageDescription>

The parameters specified in the .pkdesc file are appended to the command line arguments.

The Spotfire Package Builder output is a package file (.spk) that you can distribute and deploy to a Spotfire Server. If you specify a module definition file (module.xml) in the package description file, it is also included in the output.