object SbtWeb extends AutoPlugin
Adds settings concerning themselves with web things to SBT. Here is the directory structure supported by this plugin showing relevant sbt settings:
+ src --+ main ----+ assets .....(sourceDirectory in Assets) ------+ js ----+ public .....(resourceDirectory in Assets) ------+ css ------+ images ------+ js --+ test ----+ assets .....(sourceDirectory in TestAssets) ------+ js ----+ public .....(resourceDirectory in TestAssets) ------+ css ------+ images ------+ js + target --+ web ----+ public ------+ main --------+ css --------+ images --------+ js ------+ test --------+ css --------+ images --------+ js ----+ stage
The plugin introduces the notion of "assets" to sbt. Assets are public resources that are intended for client-side consumption e.g. by a browser. This is also distinct from sbt's existing notion of "resources" as project resources are generally not made public by a web server. The name "assets" heralds from Rails.
"public" denotes a type of asset that does not require processing i.e. these resources are static in nature.
In sbt, asset source files are considered the source for plugins that process them. When they are processed any resultant files become public. For example a coffeescript plugin would use files from "unmanagedSources in Assets" and produce them to "public in Assets".
All assets be them subject to processing or static in nature, will be copied to the public destinations.
How files are organised within "assets" or "public" is subject to the taste of the developer, their team and conventions at large.
The "stage" directory is product of processing the asset pipeline and results in files prepared for deployment to a web server.
- Alphabetic
- By Inheritance
- SbtWeb
- AutoPlugin
- PluginsFunctions
- Basic
- Plugins
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
&&(o: Basic): Plugins
- Definition Classes
- Basic → Plugins
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
allRequirements: PluginTrigger
- Definition Classes
- PluginsFunctions
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- val autoImport: Import.type
-
def
buildSettings: Seq[sbt.Def.Setting[_]]
- Definition Classes
- SbtWeb → AutoPlugin
-
def
classpathWithoutAssets(classpath: Classpath): Classpath
Remove web module dependencies from a classpath.
Remove web module dependencies from a classpath. This is a helper method for Play 2.3 transitions.
-
def
clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
-
def
copyResourceTo(to: sbt.File, url: sbt.URL, cacheDir: sbt.File): sbt.File
Copy a resource to a target folder.
Copy a resource to a target folder.
The resource won't be copied if the new file is older.
- to
the target folder.
- url
the url of the resource.
- cacheDir
the dir to cache whether the file was read or not.
- returns
the copied file.
-
def
createWebJarMappings: sbt.Def.Initialize[Task[Seq[(sbt.File, String)]]]
Create package mappings for assets in the webjar format.
Create package mappings for assets in the webjar format. Use the webjars path prefix and exclude all web module assets.
-
def
deduplicateMappings(mappings: Seq[PathMapping], deduplicators: Seq[Deduplicator]): Seq[PathMapping]
Deduplicate mappings with a sequence of deduplicator functions.
Deduplicate mappings with a sequence of deduplicator functions.
A mapping has duplicates if multiple files map to the same relative path. The deduplicators are applied to the duplicate files and the first successful deduplication is used (when a deduplicator selects a file), otherwise the duplicate mappings are left and an error will be reported when syncing the mappings.
- mappings
the mappings to deduplicate
- deduplicators
the deduplicating functions
- returns
the (possibly) deduplicated mappings
-
def
derivedProjects(proj: ProjectDefinition[_]): Seq[Project]
- Definition Classes
- AutoPlugin
-
def
empty: Plugins
- Definition Classes
- PluginsFunctions
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def exportAssets(assetConf: sbt.Configuration, exportConf: sbt.Configuration, track: sbt.TrackLevel): sbt.Def.Initialize[Task[Classpath]]
-
def
extraProjects: Seq[Project]
- Definition Classes
- AutoPlugin
-
def
finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def flattenDirectWebModules: sbt.Def.Initialize[Task[Seq[(File, String)]]]
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getInternalWebModules(conf: sbt.Configuration): sbt.Def.Initialize[Task[Seq[String]]]
Get module names for all internal web module dependencies on the classpath.
-
def
globalSettings: Seq[sbt.Def.Setting[_]]
- Definition Classes
- AutoPlugin
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
val
label: String
- Definition Classes
- AutoPlugin
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
noTrigger: PluginTrigger
- Definition Classes
- PluginsFunctions
- val nodeModulesSettings: Seq[sbt.Def.Setting[_ >: Seq[File] with Seq[Task[Seq[File]]] with Task[Seq[File]] with File <: AnyRef]]
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
packageAssetsMappings: sbt.Def.Initialize[Task[Seq[(File, String)]]]
Create package mappings for all assets, adding the optional prefix.
- def packageSettings: Seq[sbt.Setting[_]]
-
def
path(normalized: String, separator: Char = java.io.File.separatorChar): String
Transform normalized paths into platform-specific paths.
-
def
projectConfigurations: Seq[Configuration]
- Definition Classes
- SbtWeb → AutoPlugin
-
def
projectSettings: Seq[sbt.Setting[_]]
- Definition Classes
- SbtWeb → AutoPlugin
-
def
requires: JvmPlugin.type
- Definition Classes
- SbtWeb → AutoPlugin
-
def
selectFileFrom(base: sbt.File): Deduplicator
Deduplicator that selects the first file contained in the base directory.
Deduplicator that selects the first file contained in the base directory.
- base
the base directory to check against
- returns
a deduplicator function that prefers files in the base directory
-
def
selectFirstDirectory: Deduplicator
Deduplicator that checks whether all duplicates are directories and if so will simply select the first one.
Deduplicator that checks whether all duplicates are directories and if so will simply select the first one.
- returns
a deduplicator function for duplicate directories
-
def
selectFirstIdenticalFile: Deduplicator
Deduplicator that checks that all duplicates have the same contents hash and if so will simply select the first one.
Deduplicator that checks that all duplicates have the same contents hash and if so will simply select the first one.
- returns
a deduplicator function for checking identical contents
- def syncExportedAssets(track: sbt.TrackLevel): sbt.Def.Initialize[Task[sbt.File]]
-
def
syncMappings(cacheStore: CacheStore, mappings: Seq[PathMapping], target: sbt.File): sbt.File
Efficiently synchronize a sequence of mappings with a target folder.
Efficiently synchronize a sequence of mappings with a target folder.
- cacheStore
the cache store.
- mappings
the mappings to sync.
- target
the destination directory to sync to.
- returns
the target value
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AutoPlugin → AnyRef → Any
-
def
trigger: PluginTrigger
- Definition Classes
- AutoPlugin
- val unscopedAssetSettings: Seq[sbt.Setting[_]]
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... ) @native()
- def webJarsPathPrefix: sbt.Def.Initialize[Task[String]]