Package org.bladerunnerjs.model

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


  }
 
  @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

        "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

      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

      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

    }
  }
 
  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

   
    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

          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

    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

Related Classes of org.bladerunnerjs.model.JsLib

Copyright © 2018 www.massapicom. 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.