Package org.bladerunnerjs.plugin.plugins.bundlers.thirdparty

Source Code of org.bladerunnerjs.plugin.plugins.bundlers.thirdparty.ThirdpartyAssetLocation

package org.bladerunnerjs.plugin.plugins.bundlers.thirdparty;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import org.bladerunnerjs.model.AssetContainer;
import org.bladerunnerjs.model.AssetLocation;
import org.bladerunnerjs.model.BRJS;
import org.bladerunnerjs.model.JsLib;
import org.bladerunnerjs.model.ResourcesAssetLocation;
import org.bladerunnerjs.model.ThirdpartyLibManifest;
import org.bladerunnerjs.model.exception.ConfigException;

public final class ThirdpartyAssetLocation extends ResourcesAssetLocation {
  private final ThirdpartyLibManifest manifest;
 
  public ThirdpartyAssetLocation(BRJS root, AssetContainer assetContainer, File dir, AssetLocation parentAssetLocation) {
    super(root, assetContainer, dir, parentAssetLocation);
   
    try {
      manifest = new ThirdpartyLibManifest(this);
    }
    catch(ConfigException e) {
      throw new RuntimeException(e);
    }
  }
 
  public ThirdpartyLibManifest getManifest(){
    return manifest;
  }
 
  protected List<File> getCandidateFiles() {
    try {
      List<File> assetFiles = new ArrayList<>(manifest.getCssFiles());
      assetFiles.add(file("thirdparty-lib.manifest"));
     
      return assetFiles;
    }
    catch(ConfigException e) {
      throw new RuntimeException(e);
    }
  }
 
  @Override
  public String requirePrefix() {
    return ((JsLib) assetContainer()).getName();
  }
 
  @Override
  public String jsStyle() {
    return ThirdpartyAssetLocation.class.getSimpleName();
  }
}
TOP

Related Classes of org.bladerunnerjs.plugin.plugins.bundlers.thirdparty.ThirdpartyAssetLocation

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.