public class AssetCompiler extends Object
Process static files by validate or modify them in some way.
AssetProcessor,
Assets| Constructor and Description |
|---|
AssetCompiler(ClassLoader loader,
com.typesafe.config.Config conf) |
AssetCompiler(com.typesafe.config.Config conf) |
| Modifier and Type | Method and Description |
|---|---|
List<AssetAggregator> |
aggregators() |
List<String> |
assets(String name)
Get all the assets for the provided file set.
|
Asset |
build(Asset asset)
Apply the processor pipeline to the given asset.
|
Map<String,List<File>> |
build(String dist,
File dir)
Build assets using the given distribution and write output to the provided directory.
|
boolean |
contains(String path)
Test if the provided path is part of the fileset.
|
Set<String> |
fileset() |
Set<String> |
patterns()
Iterate over fileset and common path pattern for them.
|
List<AssetProcessor> |
pipeline(String dist)
List all the
AssetProcessor for a distribution (a.k.a. |
List<String> |
scripts(String fileset)
Get all the javascript (or derived) for the provided fileset.
|
List<String> |
styles(String fileset)
Get all the css files (or derived) for the provided fileset.
|
String |
toString() |
public AssetCompiler(com.typesafe.config.Config conf)
throws Exception
Exceptionpublic AssetCompiler(ClassLoader loader, com.typesafe.config.Config conf) throws Exception
Exceptionpublic List<String> assets(String name)
assets {
fileset {
home: [home.css, home.js]
}
}
This method returns home.css and home.js for home file
set. If there is no fileset under that name then it returns an empty list.name - Fileset name.public Set<String> patterns()
{
assets {
fileset {
lib: [js/lib/jquery.js],
home: [css/style.css, js/home.js]
}
}
}
This method returns a set with /css/** and /js/** pattern.public boolean contains(String path)
path - Test to test.public List<String> scripts(String fileset)
{
assets {
fileset {
mypage: [mypage.js, mypage.css]
}
}
}
This method returns mypage.js for mypage fileset.
fileset - Fileset name.public List<String> styles(String fileset)
{
assets {
fileset {
mypage: [mypage.js, mypage.css]
}
}
}
This method returns mypage.js for mypage fileset.
fileset - Fileset name.public List<AssetProcessor> pipeline(String dist)
AssetProcessor for a distribution (a.k.a. environment).dist - Distribution's name.AssetProcessor.public List<AssetAggregator> aggregators()
AssetAggregator.public Map<String,List<File>> build(String dist, File dir) throws Exception
dist - Distribution's name (usually dev or dist).dir - Output directory.Exception - If something goes wrong.public Asset build(Asset asset) throws Exception
build(String, File) but for a
single file or asset.asset - Asset to build.Exception - If something goes wrong.Copyright © 2017. All rights reserved.