mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jpikus
20.40.2009 39939cbeb2965312e1fee64c4cbf824b37ea857c
fix incorrect svn revision and add svn url in start-ds -F
1 files added
6 files modified
187 ■■■■■ changed files
opends/build.xml 17 ●●●●● patch | view | raw | blame | history
opends/resource/DynamicConstants.java.stubs 6 ●●●●● patch | view | raw | blame | history
opends/src/build-tools/org/opends/build/tools/GetSubversionRevision.java 5 ●●●● patch | view | raw | blame | history
opends/src/build-tools/org/opends/build/tools/GetSubversionUrlRepo.java 145 ●●●●● patch | view | raw | blame | history
opends/src/quicksetup/org/opends/quicksetup/BuildInformation.java 11 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/core/DirectoryServer.java 1 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/util/SetupUtils.java 2 ●●●●● patch | view | raw | blame | history
opends/build.xml
@@ -466,6 +466,21 @@
    <getsvnrevision property="REVISION_NUMBER" />
    <!-- Get the url repo of the current Subversion workspace -->
    <taskdef name="getsvnurlrepo"
             classname="org.opends.build.tools.GetSubversionUrlRepo">
      <classpath>
        <fileset dir="${build.dir}/build-tools">
          <include name="*.jar" />
        </fileset>
        <fileset dir="${svnkit.dir}">
          <include name="*.jar" />
        </fileset>
      </classpath>
    </taskdef>
    <getsvnurlrepo property="URL_REPOSITORY" />
    <!-- Construct the version number string -->
    <taskdef name="getversionnumber"
@@ -484,7 +499,7 @@
      Be warned that the .stubs file references the following properties
      PRODUCT_NAME, SHORT_NAME, MAJOR_VERSION, MINOR_VERSION, POINT_VERSION,
      VERSION_QUALIFIER, FIX_IDS, timestamp, user.name, java.version,
      java.vendor, java.vm.version, JVM_VENDOR, DEBUG_BUILD, REVISION_NUMBER,
      java.vendor, java.vm.version, JVM_VENDOR, DEBUG_BUILD, REVISION_NUMBER,URL_REPOSITORY,
      WEAVE_ENABLED, VERSION_NUMBER_STRING
      If you change the name of any of those properties in this build.xml
      you'll need to reflect the same change in the .stubs file
opends/resource/DynamicConstants.java.stubs
@@ -127,6 +127,12 @@
  public static final long REVISION_NUMBER = ${REVISION_NUMBER};
  /**
   * The Subversion url repository location on which this build is based.
   */
  public static final String URL_REPOSITORY =
      "${URL_REPOSITORY}";
  /**
   * Indicates wheater this build includes AspectJ weaving for the debug logging
   * framework.
   */
opends/src/build-tools/org/opends/build/tools/GetSubversionRevision.java
@@ -115,7 +115,9 @@
    try
    {
      SVNInfo svnInfo = ourClientManager.getWCClient().doInfo(workspacePath, SVNRevision.WORKING);
      SVNRevision revision = svnInfo.getRevision();
      SVNRevision revision = svnInfo.getCommittedRevision();
      if (revision == null)
      {
        System.err.println("WARNING:  Could not determine Subversion " +
@@ -127,6 +129,7 @@
        getProject().setNewProperty(propertyName,
                                    String.valueOf(revision.getNumber()));
      }
    }
    catch (SVNException svnException)
    {
opends/src/build-tools/org/opends/build/tools/GetSubversionUrlRepo.java
New file
@@ -0,0 +1,145 @@
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at
 * trunk/opends/resource/legal-notices/OpenDS.LICENSE.  If applicable,
 * add the following below this CDDL HEADER, with the fields enclosed
 * by brackets "[]" replaced with your own identifying information:
 *      Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 *
 *      Copyright 2009 Sun Microsystems, Inc.
 */
package org.opends.build.tools;
import java.io.File;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
import org.tmatesoft.svn.core.SVNException;
import org.tmatesoft.svn.core.wc.SVNClientManager;
import org.tmatesoft.svn.core.wc.SVNInfo;
import org.tmatesoft.svn.core.wc.SVNRevision;
import org.tmatesoft.svn.core.SVNURL;
/**
 * This class provides an implementation of an Ant task that may be used to
 * determine the current Subversion revision number of the current working
 * copy.  The value of the revision number will be stored in an Ant property.
 */
public class GetSubversionUrlRepo
       extends Task
{
  // The name of the property in which the revision number should be set.
  private String propertyName = null;
  // The path to the root of the Subversion workspace for which to retrieve the
  // revision number.
  private String workspace = null;
  // The svn client manager. Required by svnkit 1.2.x
  private static SVNClientManager ourClientManager =
          SVNClientManager.newInstance();
  /**
   * Specifies the name of the Ant property into which the Subversion revision
   * number will be stored.
   *
   * @param  propertyName  The name of the Ant property into which the
   *                       Subversion revision number will be stored.
   */
  public void setProperty(String propertyName)
  {
    this.propertyName = propertyName;
  }
  /**
   * Specifies the path to the root of the Subversion workspace for which to
   * retrieve the revision number.
   *
   * @param  workspace  The path to the root of the Subversion workspace for
   *                    which to retrieve the revision number.
   */
  public void setWorkspace(String workspace)
  {
    this.workspace = workspace;
  }
  /**
   * Performs the appropriate processing needed for this task.  In this case,
   * it uses SVNKit to identify the current revision number for the local
   * workspace and store it in a specified property.
   */
  @Override()
  public void execute()
  {
    if ((propertyName == null) || (propertyName.length() == 0))
    {
      throw new BuildException("ERROR:  No property was specified for " +
                               "storing the revision number value.");
    }
    File workspacePath;
    if ((workspace == null) || (workspace.length() == 0))
    {
      workspacePath = getProject().getBaseDir();
    }
    else
    {
      workspacePath = new File(workspace);
    }
    try
    {
      SVNInfo svnInfo = ourClientManager.getWCClient().doInfo(workspacePath, SVNRevision.WORKING);
      SVNURL url_repo = svnInfo.getURL();
      if (url_repo == null)
      {
        System.err.println("WARNING:  Could not determine Subversion URL Repository " +
                           "for current workspace.");
        getProject().setNewProperty(propertyName, "-1");
      }
      else
      {
        getProject().setNewProperty(propertyName,
                                    String.valueOf(url_repo));
      }
    }
    catch (SVNException svnException)
    {
      System.err.println("WARNING:  Could not determine Subversion " +
                         "URL repository for current workspace:  " +
                         svnException);
      getProject().setNewProperty(propertyName, "-1");
    }
  }
}
opends/src/quicksetup/org/opends/quicksetup/BuildInformation.java
@@ -254,6 +254,8 @@
            String.valueOf(DynamicConstants.VERSION_QUALIFIER));
    bi.values.put(REVISION_NUMBER,
            String.valueOf(DynamicConstants.REVISION_NUMBER));
    bi.values.put(URL_REPOSITORY,
            String.valueOf(DynamicConstants.URL_REPOSITORY));
    bi.values.put(FIX_IDS, DynamicConstants.FIX_IDS);
    bi.values.put(DEBUG_BUILD, String.valueOf(DynamicConstants.DEBUG_BUILD));
    bi.values.put(BUILD_OS, DynamicConstants.BUILD_OS);
@@ -341,6 +343,15 @@
  }
  /**
   * Gets the SVN URL repository.
   *
   * @return String representing the SVN URL repository
   */
  public String getURLRepository() {
    return new String(values.get(URL_REPOSITORY));
  }
  /**
   * Gets the set of IDs representing <code>IncompatibleVersionEvents</code>.
   * @return set of integers representing events
   * @see org.opends.server.util.VersionCompatibilityIssue
opends/src/server/org/opends/server/core/DirectoryServer.java
@@ -9942,6 +9942,7 @@
                     new DecimalFormat("000").format(BUILD_NUMBER));
    }
    System.out.println(SetupUtils.REVISION_NUMBER+separator+REVISION_NUMBER);
    System.out.println(SetupUtils.URL_REPOSITORY+separator+URL_REPOSITORY);
    System.out.println(SetupUtils.FIX_IDS+separator+FIX_IDS);
    System.out.println(SetupUtils.DEBUG_BUILD+separator+DEBUG_BUILD);
    System.out.println(SetupUtils.BUILD_OS+separator+BUILD_OS);
opends/src/server/org/opends/server/util/SetupUtils.java
@@ -107,6 +107,8 @@
  public static final String POINT_VERSION = "Point Version";
  /** Revision number in SVN. */
  public static final String REVISION_NUMBER = "Revision Number";
  /** the SVN url repository. */
  public static final String URL_REPOSITORY = "URL Repository";
  /** The version qualifier. */
  public static final String VERSION_QUALIFIER = "Version Qualifier";
  /** Incompatibilities found between builds (used by the upgrade tool). */