Package com.subhajit.build

Examples of com.subhajit.build.Manifest$Section


  public void createBeanCreateCloneThenCloneShouldHaveSameStructureAndValuesButEveryElementOfDifferentReference() {
   
    // create some data
    // use a.b.m2.Book which has 1:N relations (collection) to other beans
    Book book = new Book("History of Britain", "John O'Farrel", ImmutableList.copyOf(new Section[] {
      new Section("Section1", "no description", ImmutableSet.copyOf(new Paragraph[] {
          new Paragraph(1, "Bla bla bla"),
          new Paragraph(1, "Bla bla bla"),
      })),
      new Section("Section2", "no description", ImmutableSet.copyOf(new Paragraph[] {
          new Paragraph(1066, "Bla bla bla"),
      })),
      new Section("Section3", "no description", ImmutableSet.copyOf(new Paragraph[] {
          new Paragraph(1, "Bla bla bla"),
          new Paragraph(2, "Bla bla bla"),
          new Paragraph(3, "Bla bla bla"),
      })),
    }));
View Full Code Here


public class SimpleApp {
  public static void main(String[] args) {
    // create some data
    // use a.b.m2.Book which has 1:N relations (collection) to other beans
    Book book = new Book("History of Britain", "John O'Farrel", ImmutableList.copyOf(new Section[] {
      new Section("Section1", "no description", ImmutableSet.copyOf(new Paragraph[] {
          new Paragraph(1, "Bla bla bla"),
          new Paragraph(1, "Bla bla bla"),
      })),
      new Section("Section2", "no description", ImmutableSet.copyOf(new Paragraph[] {
          new Paragraph(1066, "Bla bla bla"),
      })),
      new Section("Section3", "no description", ImmutableSet.copyOf(new Paragraph[] {
          new Paragraph(1, "Bla bla bla"),
          new Paragraph(2, "Bla bla bla"),
          new Paragraph(3, "Bla bla bla"),
      })),
    }));
View Full Code Here

        // Create the project jar file.
        File projectJarFile = new File(zipDir, eclipseProject.getName()
            + ".jar");
        // Update the manifest.
        // If there is already a manifest file, load it.
        Manifest manifest = null;
        File manifestFile = new File(projectJarDir,
            "META-INF/MANIFEST.MF");
        if (manifestFile.exists()) {
          manifest = loadManifest(manifestFile);
        } else {
          manifest = CreateJarUtils.createDefaultManifest();
        }
        progress.increment(1, "Creating manifest files");
        if (manifest.getMainSection().getAttribute("Main-Class") != null) {
          manifest.getMainSection().removeAttribute("Main-Class");
        }
        manifest.getMainSection().addConfiguredAttribute(
            new Manifest.Attribute("Main-Class", mainClass));
        FileUtils.mkdirs(manifestFile.getParentFile());
        saveManifest(manifestFile, manifest);

        // Create the jar.
View Full Code Here

  private static Manifest loadManifest(File manifestFile) throws IOException,
      ManifestException {
    StringReader reader = null;
    try {
      reader = new StringReader(FileUtils.loadTextFile(manifestFile));
      return new Manifest(reader);
    } finally {
      if (reader != null) {
        reader.close();
      }
    }
View Full Code Here

  static final URL[] ZERO_LENGTH_URL_ARRAY = new URL[0];

  protected static Manifest createManifest(EclipseProject project,
      String mainClass) throws ManifestException, IOException,
      JDOMException, InterruptedException {
    Manifest ret = createDefaultManifest();

    if (mainClass != null) {
      ret.addConfiguredAttribute(new Manifest.Attribute("Main-Class",
          mainClass));
    }

    // Get all classpath elements.
    StringBuilder str = new StringBuilder();
    for (EclipseMetafile metafile : project.getAllDependants()) {
      if (metafile instanceof CompiledJar) {
        if (str.length() != 0) {
          str.append(" ");
        }
        str.append(((CompiledJar) metafile).getFile().getName());
      }
    }
    ret.addConfiguredAttribute(new Manifest.Attribute("Class-Path", str
        .toString()));
    return ret;
  }
View Full Code Here

        .toString()));
    return ret;
  }

  static Manifest createDefaultManifest() throws ManifestException {
    Manifest ret = new Manifest();
    ret.addConfiguredAttribute(new Manifest.Attribute("Manifest-Version",
        "1.0"));
    ret.addConfiguredAttribute(new Manifest.Attribute("Archiver-Version",
        "Subhajit's eclipse plugin."));
    ret.addConfiguredAttribute(new Manifest.Attribute("Created-By",
        "ClassTools plugin."));
    return ret;
  }
View Full Code Here

   */
  protected static void createManifestFiles(File outputDirectory,
      EclipseProject project, String mainClass, IProgress... progresses)
      throws ManifestException, IOException, JDOMException,
      InterruptedException {
    Manifest manifest = createManifest(project, mainClass);
    saveManifest(outputDirectory, manifest);
  }
View Full Code Here

      throw new IllegalArgumentException("Run directory not given.");
    }

    // Export the process-manager.jar file to the "dir" directory.
    Class<?> klass = ProcessManagerMain.class;
    Manifest manifest = new Manifest();
    manifest.getMainSection().addConfiguredAttribute(
        new Manifest.Attribute("Premain-Class",
            ProcessManagerMain.class.getName()));
    DistributionManager.createDistributionWithAdditionalClasses(Thread
        .currentThread().getContextClassLoader(), new File(dir,
        "process-manager.jar"), manifest, klass.getName(),
View Full Code Here

    Body body = new Body();
    Mdiv mdiv = new Mdiv();
    Score score = new Score();
    ScoreDef scoreDef = createScoreDef(stavesCount);
    score.getGapsAndSbsAndCorrs().add(scoreDef);
    Section section = new Section();
    Measure measureFirst = new Measure();
    Staff staffFirst = new Staff();
    Layer layerFirst = new Layer();
    staffFirst.getSbsAndSymbolsAndOrigs().add(layerFirst);
    measureFirst.getAnnotsAndSlursAndTupletSpen().add(staffFirst);
    for (int stavesIter = 1; stavesIter < stavesCount; stavesIter++) {
      Staff staff = new Staff();
      Layer layer = new Layer();
      staff.getSbsAndSymbolsAndOrigs().add(layer);
      measureFirst.getAnnotsAndSlursAndTupletSpen().add(staff);
    }
    section.getUnclearsAndSbsAndApps().add(measureFirst);

    for (int measureIter = 1; measureIter < measureCount; measureIter++) {
      Measure measure = new Measure();
      for (int stavesIter = 0; stavesIter < stavesCount; stavesIter++) {
        Staff staff = new Staff();
        Layer layer = new Layer();
        staff.getSbsAndSymbolsAndOrigs().add(layer);
        measure.getAnnotsAndSlursAndTupletSpen().add(staff);
      }
      section.getUnclearsAndSbsAndApps().add(measure);
    }
    score.getGapsAndSbsAndCorrs().add(section);
    mdiv.setScore(score);
    body.getMdivs().add(mdiv);
    music.setBody(body);
View Full Code Here

    tpd.setDescription(MusicMessages.MEI_documentation_generic_n);
    descriptors.add(tpd);
  }
 
  private void createDefaultSection() {
    setMeiNode(new Section());
  }
View Full Code Here

TOP

Related Classes of com.subhajit.build.Manifest$Section

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.