Examples of JsLib


Examples of org.bladerunnerjs.model.JsLib

        }
   
    App app = brjs.app(appName);
    if(!app.dirExists()) throw new NodeDoesNotExistException(app, this);
   
    JsLib library = app.appJsLib(libraryName);
    if (library.dirExists()) throw new NodeAlreadyExistsException(library, this);
   
    switch ( createLibraryType ) {
      case br:
        break;
      case thirdparty:
        createThirdpartyManifest(library);
        break;
    }
   
    try {
      library.populate();
    }
    catch(InvalidNameException e) {
      throw new CommandArgumentsException(e, this);
    }
    catch(ModelUpdateException e) {
      throw new CommandOperationException("Cannot create library '" + library.dir().getPath() + "'", e);
    }
   
    logger.println(Messages.LIBRARY_CREATE_SUCCESS_CONSOLE_MSG, libraryName);
    logger.println(Messages.LIBRARY_PATH_CONSOLE_MSG, library.dir().getPath());
   
    return 0;
  }
View Full Code Here

Examples of org.bladerunnerjs.model.JsLib

  }
 
  @Test
  public void testLibraryResourceRequestCanNotHaveAQueryString() throws Exception
  {
    JsLib appLib = app.jsLib("myLib");
   
    given(appLib).hasBeenCreated()
      .and(appLib).containsFileWithContents("thirdparty-lib.manifest", "js: myFile.js")
      .and(appLib).containsFile("myFile.js");
    when(aspect).requestReceivedInDev("thirdparty/myLib/myFile.js?q=1234", pageResponse);
View Full Code Here

Examples of org.bladerunnerjs.model.JsLib

        "appns.Class1 = function()");
  }
 
  @Test
  public void methodsWithTheSameNameAsALibraryDontIncludeTheLibrary() throws Exception {
    JsLib normalizeLib = app.jsLib("normalize");
    given(normalizeLib).containsFileWithContents("thirdparty-lib.manifest", "depends:")
      .and(normalizeLib).containsFileWithContents("script.js", "normalizeLib JS")
      .and(aspect).hasNamespacedJsPackageStyle()
      .and(aspect).indexPageRefersTo("appns.Class1")
      .and(aspect).classFileHasContent("appns.Class1", "e.normalize()");
View Full Code Here

Examples of org.bladerunnerjs.model.JsLib

      Workbench workbench = blade.workbench();
      resourceFile = workbench.file(resourcePath);
    }
    else if (contentPath.formName.equals(LIB_REQUEST))
    {
      JsLib jsLib = bundlableNode.app().jsLib(contentPath.properties.get("lib"));
      resourceFile = jsLib.file(resourcePath);
    }
    else
    {
      throw new ContentProcessingException("Cannot handle request with form name " + contentPath.formName);
    }
View Full Code Here

Examples of org.bladerunnerjs.model.JsLib

      resourcesRequestName = WORKBENCH_RESOURCE_REQUEST;
      requestArgs = new String[] { bladeset.getName(), blade.getName() };
    }
    else if (assetContainer instanceof JsLib)
    {
      JsLib lib = (JsLib) assetContainer;
      themeRequestName = null;
      resourcesRequestName = LIB_REQUEST;
      requestArgs = new String[] { lib.getName() };
    }
    else {
      return contentPaths;
    }
   
View Full Code Here

Examples of org.bladerunnerjs.model.JsLib

    }
  }
 
  private void addBootstrapAndDependencies(List<SourceModule> bootstrappingSourceModules) throws ModelOperationException
  {
    JsLib boostrapLib = bundlableNode.app().jsLib(BOOTSTRAP_LIB_NAME);
    for (Asset asset : boostrapLib.linkedAssets()) {
      if (asset instanceof SourceModule) {
        addSourceModule( (SourceModule) asset );
        addAllSourceModuleDependencies( (SourceModule) asset, bootstrappingSourceModules );           
      }
    }
    for (AssetLocation assetLocation : boostrapLib.assetLocations()) {
      addUnscopedAssetLocation(assetLocation);         
    }
  }
View Full Code Here

Examples of org.bladerunnerjs.model.JsLib

   
    try
    {
      for (String dependentLibName : manifest.getDepends())
      {
        JsLib dependentLib = bundlableNode.app().jsLib(dependentLibName);
        if (!dependentLib.dirExists())
        {
          throw new ConfigException(String.format("Library '%s' depends on the library '%s', which doesn't exist.", dir().getName(), dependentLibName)) ;
        }
        dependentLibs.addAll(dependentLib.linkedAssets());
      }
    }
    catch (ConfigException ex)
    {
      throw new ModelOperationException( ex );
View Full Code Here

Examples of org.bladerunnerjs.model.JsLib

          String resourcePath = RelativePathUtility.get(root.getFileInfoAccessor(), workbench.dir(), imageFile);
          targetPath = cssResourceContentPathParser.createRequest(CssResourceContentPlugin.WORKBENCH_RESOURCE_REQUEST, bladeset.getName(), blade.getName(), resourcePath);
        }
      }
      else if(assetContainer instanceof JsLib) {
        JsLib jsLib = (JsLib) assetContainer;
        String resourcePath = RelativePathUtility.get(root.getFileInfoAccessor(), jsLib.dir(), imageFile);
       
        targetPath = cssResourceContentPathParser.createRequest(CssResourceContentPlugin.LIB_REQUEST, jsLib.getName(), resourcePath);
      }
      else {
        throw new ContentFileProcessingException(imageFile, "File does not exist in a known scope");
      }
    }
View Full Code Here

Examples of org.bladerunnerjs.model.JsLib

    return Joiner.on(", ").join(libNames);
  }

  public void libWithNameIs(String libName, JsLib appOverriddenNonBRLib)
  {
    JsLib appJsLib = app.jsLib(libName);
    appJsLib = (appJsLib instanceof AppSdkJsLib) ? ((AppSdkJsLib) appJsLib).getWrappedJsLib() : appJsLib;
    assertSame(appJsLib, appOverriddenNonBRLib);
  }
View Full Code Here
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.