Esempio n. 1
0
  private static void generateP2FinalCall(
      AntScript script, String productFileLocation, String versionAdvice) {
    script.printTab();
    script.print("<p2.generator "); // $NON-NLS-1$
    script.printAttribute(
        "append", Utils.getPropertyFormat(PROPERTY_P2_APPEND), true); // $NON-NLS-1$
    script.printAttribute(
        "flavor", Utils.getPropertyFormat(PROPERTY_P2_FLAVOR), true); // $NON-NLS-1$
    script.printAttribute(
        "compress", Utils.getPropertyFormat(PROPERTY_P2_COMPRESS), true); // $NON-NLS-1$
    script.printAttribute(
        "metadataRepository",
        Utils.getPropertyFormat(PROPERTY_P2_METADATA_REPO),
        true); //$NON-NLS-1$
    script.printAttribute(
        "artifactRepository",
        Utils.getPropertyFormat(PROPERTY_P2_ARTIFACT_REPO),
        true); //$NON-NLS-1$
    script.printAttribute(
        "metadataRepositoryName",
        Utils.getPropertyFormat(PROPERTY_P2_METADATA_REPO_NAME),
        true); //$NON-NLS-1$
    script.printAttribute(
        "artifactRepositoryName",
        Utils.getPropertyFormat(PROPERTY_P2_ARTIFACT_REPO_NAME),
        true); //$NON-NLS-1$
    script.printAttribute(
        "publishArtifacts",
        Utils.getPropertyFormat(PROPERTY_P2_PUBLISH_ARTIFACTS),
        true); //$NON-NLS-1$
    script.printAttribute("mode", "final", true); // $NON-NLS-1$ //$NON-NLS-2$

    if (productFileLocation != null) {
      script.printAttribute("productFile", productFileLocation, true); // $NON-NLS-1$
      if (versionAdvice != null)
        script.printAttribute("versionAdvice", versionAdvice, true); // $NON-NLS-1$
    } else {
      script.printAttribute(
          "root", Utils.getPropertyFormat(PROPERTY_P2_ROOT_NAME), true); // $NON-NLS-1$
      script.printAttribute(
          "rootVersion", Utils.getPropertyFormat(PROPERTY_P2_ROOT_VERSION), true); // $NON-NLS-1$
    }

    script.println("/>"); // $NON-NLS-1$
  }
Esempio n. 2
0
  protected void generateMetadataTarget() {
    if (configScriptGenerator.haveP2Bundles()) {
      script.printTargetDeclaration(TARGET_P2_METADATA, null, TARGET_P2_METADATA, null, null);

      ProductFile product = configScriptGenerator.getProductFile();
      String productPath = null;
      if (product != null) {
        File productFile = new File(product.getLocation());
        String modLocation = getProductDir() + productFile.getName();
        script.printAvailableTask(PROPERTY_P2_PRODUCT_MOD, modLocation, modLocation);
        script.printProperty(PROPERTY_P2_PRODUCT_MOD, product.getLocation());
        productPath = Utils.getPropertyFormat(PROPERTY_P2_PRODUCT_MOD);
      }

      script.printProperty(PROPERTY_P2_APPEND, "true"); // $NON-NLS-1$
      script.printProperty(PROPERTY_P2_COMPRESS, "false"); // $NON-NLS-1$
      script.printProperty(PROPERTY_P2_METADATA_REPO_NAME, ""); // $NON-NLS-1$
      script.printProperty(PROPERTY_P2_ARTIFACT_REPO_NAME, ""); // $NON-NLS-1$

      String versionAdvice = null;
      if (versionsList && product != null) {
        if (product.useFeatures())
          versionAdvice =
              getWorkingDirectory()
                  + '/'
                  + DEFAULT_FEATURE_VERSION_FILENAME_PREFIX
                  + PROPERTIES_FILE_SUFFIX;
        else
          versionAdvice =
              getWorkingDirectory()
                  + '/'
                  + DEFAULT_PLUGIN_VERSION_FILENAME_PREFIX
                  + PROPERTIES_FILE_SUFFIX;
      }
      generateP2FinalCall(script, productPath, versionAdvice);
      script.printTargetEnd();
    }
  }