Fork me on GitHub

scalor:scala-js-link-main

Full name:

com.carrotgarden.maven:scalor-maven-plugin_2.12:1.5.0.20190502181145:scala-js-link-main

Description:

Generate Scala.js runtime JavaScript for scope=main. Provides incremental linking in M2E. A member of goal=scala-js-link.

Attributes:

  • Requires a Maven project to be executed.
  • Requires dependency resolution of artifacts in scope: compile.
  • Binds by default to the lifecycle phase: process-classes.

Optional Parameters

Name Type Since Description
<commonMappingPattern> String - Regular expression for plugin configuration map values provided in pom.xml. Extractor for pattern: key=value. Must define exactly two regex capture groups. Mapping regular expression is used as follows:
  case commonMappingPattern.r( key, value ) => ( key, value )
Note: <![CDATA[ ... ]]> brackets can help preserve text entries in pom.xml.
Default value is: \s*([^=\s]+)\s*=\s*([^\s]+)\s*.
User property is: scalor.commonMappingPattern.
<commonSequenceSeparator> String - Separator for plugin configuration list values provided in pom.xml. Separator regular expression is used as follows:
  string.split( commonSequenceSeparator ).map( _.trim ).filterNot( _.isEmpty )
Note: <![CDATA[ ... ]]> brackets can help preserve text entries in pom.xml. Note: to insert unicode symbol in Eclipse/GTK, type CTRL+SHIFT+U, then XXXX - a 4-hex-digit unicode value. For example, for star ★, use hex code 2605.
Default value is: [★\n]+.
User property is: scalor.commonSequenceSeparator.
<linkerClassRegex> String - Regular expression used to discover Scala.js IR classes from class path.
Default value is: .+[.]sjsir.
User property is: scalor.linkerClassRegex.
<linkerInitializerRegex> String - Regular expression used to extract Scala.js module initializer configuration. Must provide extractor for pattern: packageName.ClassName.methodName(arg0,arg1,...). Must provide exactly 3 capture groups: class, method, arguments. Arguments separator is hard-coded comma , not part of this regex.
Default value is: ([a-zA-Z_.0-9]+)[.]([a-zA-Z_0-9]+)[(]([^()]*)[)].
User property is: scalor.linkerInitializerRegex.
<linkerLibraryDetect> boolean - Invoke Scala.js linker only when Scala.js library is detected in project dependencies with given scope. Detection parameter: linkerLibraryRegex.
Default value is: true.
User property is: scalor.linkerLibraryDetect.
<linkerLibraryRegex> String - Regular expression used to discover Scala.js core sjsir library from class path. This regular expression is matched against resolved project depenencies in given scope. Regular expression in the form: ${groupId}:${artifactId}. Enablement parameter: linkerLibraryDetect.
Default value is: org.scala-js:scalajs-library_.+.
User property is: scalor.linkerLibraryRegex.
<linkerLogBuildStats> boolean - Enable logging of Scala.js linker build phase statistics, including phase durations. Use to review linker performance profile.
Default value is: false.
User property is: scalor.linkerLogBuildStats.
<linkerLogClassPath> boolean - Enable logging of Scala.js linker class path. Use to review actual resources used for *.sjsir class discovery.
Default value is: false.
User property is: scalor.linkerLogClassPath.
<linkerLogOptions> boolean - Enable logging of linker options. Use to review actual Scala.js linker invocation configuration.
Default value is: false.
User property is: scalor.linkerLogOptions.
<linkerLogRuntime> boolean - Enable logging of Scala.js linker runtime.js. Use to review actual generated output runtime.js location.
Default value is: true.
User property is: scalor.linkerLogRuntime.
<linkerLogUpdateResult> boolean - Enable logging of Scala.js linker update result of M2E incremental change detection. Use to review actual *.sjsir classes which triggered Eclipse linker build.
Default value is: false.
User property is: scalor.linkerLogUpdateResult.
<linkerMainBuildMode> String - Build mode for non-optimized linkerMainRuntimeJs. Normally uses always, to link during both Maven full build and Eclipse incremental build. Available build modes:
  always - link during both full and incremental build
  never  - do not produce runtime at all
  full   - link only during full build
  incr   - link only during incremental build

Default value is: always.
User property is: scalor.linkerMainBuildMode.
<linkerMainBuildModeMin> String - Build mode for optimized/minified linkerMainRuntimeMinJs. Normally uses full, to link only during Maven full build and skip Eclipse incremental build. Available build modes:
  always - link during both full and incremental build
  never  - do not produce runtime at all
  full   - link only during full build
  incr   - link only during incremental build

Default value is: full.
User property is: scalor.linkerMainBuildModeMin.
<linkerMainBuildOptions> String - Build options for non-optimized linkerMainRuntimeJs. Scala.js linker options for scope=main, mode=development. Scala.js linker options reference: StandardLinker.scala Uses simple json format.
Default value is: { "checkIR":false, "parallel":true, "batchMode":false, "sourceMap":true, "optimizer":false, "prettyPrint":true, "closureCompiler":false } .
User property is: scalor.linkerMainBuildOptions.
<linkerMainBuildOptionsMin> String - Build options for optimized/minified linkerMainRuntimeMinJs. Scala.js linker options for scope=main, mode=production. Scala.js linker options reference: StandardLinker.scala Uses simple json format.
Default value is: { "checkIR":false, "parallel":true, "batchMode":true, "sourceMap":true, "optimizer":true, "prettyPrint":false, "closureCompiler":true } .
User property is: scalor.linkerMainBuildOptionsMin.
<linkerMainDependencyFolders> File[] - Folders with classes generated by current project and included in linker class path. Normally includes build output from scope=[macro,main] (target/classes).
Default value is: ${project.build.outputDirectory}.
User property is: scalor.linkerMainDependencyFolders.
<linkerMainDependencyScopes> String[] - Provide linker class path from project dependency artifacts based on these scopes. Scopes reference.
Default value is: provided.
User property is: scalor.linkerMainDependencyScopes.
<linkerMainInitializerList> String[] - List of Scala.js module initializer declarations. Module initializers are JavaScript equivalent to Java main method convention. They are invoked when linker-generated runtime.js script is loaded in Node.js or Browser JS-VM. Each list entry must be a fully qualified class name of Scala object, with method name, with argument list, which follows Java main contract, and is annotated with @JSExportTopLevel, @JSExport. For example, the following pom.xml plugin configuration entry:
<linkerTestInitializerList>
   <initializer>test.Init.main(build=${project.artifactId},stamp=${maven.build.timestamp})</initializer>
</linkerTestInitializerList>
must be accompanied by Scala object in file test/Init.scala:
package test
import scala.scalajs.js.annotation._
@JSExportTopLevel( "test.Init" )
object Init {
  @JSExport
  // Arguments contain "build" and "stamp" entries from pom.xml.
  def main( args : Array[ String ] ) : Unit = {
    // This module output is printed on JS-VM console (Node.js or Browser).
    println( s"init-main: ${args(0)} ${args(1)}" )
  }
}
This list is empty by default. Extractor parameter: linkerInitializerRegex.
User property is: scalor.linkerMainInitializerList.
<linkerMainRuntimeJs> String - Non-optimized runtime script. Relative path of the generated runtime JavaScript file for scope=main, mode=development. File is packaged inside linkerMainTargetFolder Normally follows webjars convention.
Default value is: ${project.artifactId}/${project.version}/runtime.js.
User property is: scalor.linkerMainRuntimeJs.
<linkerMainRuntimeMinJs> String - Linker optimized/minified runtime script. Relative path of the generated runtime JavaScript file for scope=main, mode=production. File is packaged inside linkerMainTargetFolder Normally follows webjars convention.
Default value is: ${project.artifactId}/${project.version}/runtime.min.js.
User property is: scalor.linkerMainRuntimeMinJs.
<linkerMainTargetFolder> File - Build target directory for the generated runtime JavaScript file with scope=main. Normally packaged inside target/classes. Normally follows webjars convention.
Default value is: ${project.build.outputDirectory}/META-INF/resources/webjars.
User property is: scalor.linkerMainTargetFolder.
<skip> boolean - Force to skip all executions of this plugin.
Default value is: false.
User property is: scalor.skip.
<skipLinker> boolean - Flag to skip this execution: scala-js-link-*.
Default value is: false.
User property is: scalor.skipLinker.
<skipLinkerMain> boolean - Flag to skip goal execution: scala-js-link-main.
Default value is: false.
User property is: scalor.skipLinkerMain.
<skipLogReason> boolean - Enable logging of reason for skipping an execution.
Default value is: true.
User property is: scalor.skipLogReason.
<skipPackagingList> String[] - List of packaging types, which are skipped by this plugin.
Default value is: pom.
User property is: scalor.skipPackagingList.

Parameter Details

<commonMappingPattern>

Regular expression for plugin configuration map values provided in pom.xml. Extractor for pattern: key=value. Must define exactly two regex capture groups. Mapping regular expression is used as follows:
  case commonMappingPattern.r( key, value ) => ( key, value )
Note: <![CDATA[ ... ]]> brackets can help preserve text entries in pom.xml.
  • Type: java.lang.String
  • Required: No
  • User Property: scalor.commonMappingPattern
  • Default: \s*([^=\s]+)\s*=\s*([^\s]+)\s*

<commonSequenceSeparator>

Separator for plugin configuration list values provided in pom.xml. Separator regular expression is used as follows:
  string.split( commonSequenceSeparator ).map( _.trim ).filterNot( _.isEmpty )
Note: <![CDATA[ ... ]]> brackets can help preserve text entries in pom.xml. Note: to insert unicode symbol in Eclipse/GTK, type CTRL+SHIFT+U, then XXXX - a 4-hex-digit unicode value. For example, for star ★, use hex code 2605.
  • Type: java.lang.String
  • Required: No
  • User Property: scalor.commonSequenceSeparator
  • Default: [★\n]+

<linkerClassRegex>

Regular expression used to discover Scala.js IR classes from class path.
  • Type: java.lang.String
  • Required: No
  • User Property: scalor.linkerClassRegex
  • Default: .+[.]sjsir

<linkerInitializerRegex>

Regular expression used to extract Scala.js module initializer configuration. Must provide extractor for pattern: packageName.ClassName.methodName(arg0,arg1,...). Must provide exactly 3 capture groups: class, method, arguments. Arguments separator is hard-coded comma , not part of this regex.
  • Type: java.lang.String
  • Required: No
  • User Property: scalor.linkerInitializerRegex
  • Default: ([a-zA-Z_.0-9]+)[.]([a-zA-Z_0-9]+)[(]([^()]*)[)]

<linkerLibraryDetect>

Invoke Scala.js linker only when Scala.js library is detected in project dependencies with given scope. Detection parameter: linkerLibraryRegex.
  • Type: boolean
  • Required: No
  • User Property: scalor.linkerLibraryDetect
  • Default: true

<linkerLibraryRegex>

Regular expression used to discover Scala.js core sjsir library from class path. This regular expression is matched against resolved project depenencies in given scope. Regular expression in the form: ${groupId}:${artifactId}. Enablement parameter: linkerLibraryDetect.
  • Type: java.lang.String
  • Required: No
  • User Property: scalor.linkerLibraryRegex
  • Default: org.scala-js:scalajs-library_.+

<linkerLogBuildStats>

Enable logging of Scala.js linker build phase statistics, including phase durations. Use to review linker performance profile.
  • Type: boolean
  • Required: No
  • User Property: scalor.linkerLogBuildStats
  • Default: false

<linkerLogClassPath>

Enable logging of Scala.js linker class path. Use to review actual resources used for *.sjsir class discovery.
  • Type: boolean
  • Required: No
  • User Property: scalor.linkerLogClassPath
  • Default: false

<linkerLogOptions>

Enable logging of linker options. Use to review actual Scala.js linker invocation configuration.
  • Type: boolean
  • Required: No
  • User Property: scalor.linkerLogOptions
  • Default: false

<linkerLogRuntime>

Enable logging of Scala.js linker runtime.js. Use to review actual generated output runtime.js location.
  • Type: boolean
  • Required: No
  • User Property: scalor.linkerLogRuntime
  • Default: true

<linkerLogUpdateResult>

Enable logging of Scala.js linker update result of M2E incremental change detection. Use to review actual *.sjsir classes which triggered Eclipse linker build.
  • Type: boolean
  • Required: No
  • User Property: scalor.linkerLogUpdateResult
  • Default: false

<linkerMainBuildMode>

Build mode for non-optimized linkerMainRuntimeJs. Normally uses always, to link during both Maven full build and Eclipse incremental build. Available build modes:
  always - link during both full and incremental build
  never  - do not produce runtime at all
  full   - link only during full build
  incr   - link only during incremental build
  • Type: java.lang.String
  • Required: No
  • User Property: scalor.linkerMainBuildMode
  • Default: always

<linkerMainBuildModeMin>

Build mode for optimized/minified linkerMainRuntimeMinJs. Normally uses full, to link only during Maven full build and skip Eclipse incremental build. Available build modes:
  always - link during both full and incremental build
  never  - do not produce runtime at all
  full   - link only during full build
  incr   - link only during incremental build
  • Type: java.lang.String
  • Required: No
  • User Property: scalor.linkerMainBuildModeMin
  • Default: full

<linkerMainBuildOptions>

Build options for non-optimized linkerMainRuntimeJs. Scala.js linker options for scope=main, mode=development. Scala.js linker options reference: StandardLinker.scala Uses simple json format.
  • Type: java.lang.String
  • Required: No
  • User Property: scalor.linkerMainBuildOptions
  • Default: { "checkIR":false, "parallel":true, "batchMode":false, "sourceMap":true, "optimizer":false, "prettyPrint":true, "closureCompiler":false }

<linkerMainBuildOptionsMin>

Build options for optimized/minified linkerMainRuntimeMinJs. Scala.js linker options for scope=main, mode=production. Scala.js linker options reference: StandardLinker.scala Uses simple json format.
  • Type: java.lang.String
  • Required: No
  • User Property: scalor.linkerMainBuildOptionsMin
  • Default: { "checkIR":false, "parallel":true, "batchMode":true, "sourceMap":true, "optimizer":true, "prettyPrint":false, "closureCompiler":true }

<linkerMainDependencyFolders>

Folders with classes generated by current project and included in linker class path. Normally includes build output from scope=[macro,main] (target/classes).
  • Type: java.io.File[]
  • Required: No
  • User Property: scalor.linkerMainDependencyFolders
  • Default: ${project.build.outputDirectory}

<linkerMainDependencyScopes>

Provide linker class path from project dependency artifacts based on these scopes. Scopes reference.
  • Type: java.lang.String[]
  • Required: No
  • User Property: scalor.linkerMainDependencyScopes
  • Default: provided

<linkerMainInitializerList>

List of Scala.js module initializer declarations. Module initializers are JavaScript equivalent to Java main method convention. They are invoked when linker-generated runtime.js script is loaded in Node.js or Browser JS-VM. Each list entry must be a fully qualified class name of Scala object, with method name, with argument list, which follows Java main contract, and is annotated with @JSExportTopLevel, @JSExport. For example, the following pom.xml plugin configuration entry:
<linkerTestInitializerList>
   <initializer>test.Init.main(build=${project.artifactId},stamp=${maven.build.timestamp})</initializer>
</linkerTestInitializerList>
must be accompanied by Scala object in file test/Init.scala:
package test
import scala.scalajs.js.annotation._
@JSExportTopLevel( "test.Init" )
object Init {
  @JSExport
  // Arguments contain "build" and "stamp" entries from pom.xml.
  def main( args : Array[ String ] ) : Unit = {
    // This module output is printed on JS-VM console (Node.js or Browser).
    println( s"init-main: ${args(0)} ${args(1)}" )
  }
}
This list is empty by default. Extractor parameter: linkerInitializerRegex.
  • Type: java.lang.String[]
  • Required: No
  • User Property: scalor.linkerMainInitializerList

<linkerMainRuntimeJs>

Non-optimized runtime script. Relative path of the generated runtime JavaScript file for scope=main, mode=development. File is packaged inside linkerMainTargetFolder Normally follows webjars convention.
  • Type: java.lang.String
  • Required: No
  • User Property: scalor.linkerMainRuntimeJs
  • Default: ${project.artifactId}/${project.version}/runtime.js

<linkerMainRuntimeMinJs>

Linker optimized/minified runtime script. Relative path of the generated runtime JavaScript file for scope=main, mode=production. File is packaged inside linkerMainTargetFolder Normally follows webjars convention.
  • Type: java.lang.String
  • Required: No
  • User Property: scalor.linkerMainRuntimeMinJs
  • Default: ${project.artifactId}/${project.version}/runtime.min.js

<linkerMainTargetFolder>

Build target directory for the generated runtime JavaScript file with scope=main. Normally packaged inside target/classes. Normally follows webjars convention.
  • Type: java.io.File
  • Required: No
  • User Property: scalor.linkerMainTargetFolder
  • Default: ${project.build.outputDirectory}/META-INF/resources/webjars

<skip>

Force to skip all executions of this plugin.
  • Type: boolean
  • Required: No
  • User Property: scalor.skip
  • Default: false

<skipLinker>

Flag to skip this execution: scala-js-link-*.
  • Type: boolean
  • Required: No
  • User Property: scalor.skipLinker
  • Default: false

<skipLinkerMain>

Flag to skip goal execution: scala-js-link-main.
  • Type: boolean
  • Required: No
  • User Property: scalor.skipLinkerMain
  • Default: false

<skipLogReason>

Enable logging of reason for skipping an execution.
  • Type: boolean
  • Required: No
  • User Property: scalor.skipLogReason
  • Default: true

<skipPackagingList>

List of packaging types, which are skipped by this plugin.
  • Type: java.lang.String[]
  • Required: No
  • User Property: scalor.skipPackagingList
  • Default: pom