How to copy VSS project from one VSS database to another one without loosing history

copy-vss-project-from-one-vss-database-to-another-one-without-loosing-history

If you have any of the following questions in your mind, then this article is the perfect destination for you.

  • How to copy VSS project from one VSS database to another one without loosing history
  • How to move VSS project from one location to another location
  • Moving Visual SourceSafe projects or databases to a new location?
  • Moving a project or projects from one database to another, while preserving the project’s history?

The procedures within each scenario may vary depending on the version of Visual SourceSafe you are running.

APPLIES TO

Microsoft Visual SourceSafe 5.0 Standard Edition

Microsoft Visual SourceSafe 6.0 Standard Edition

NOTE: This process is for Visual SourceSafe 5.0 or greater only.

Requirement:

1.   Use the SSARC and SSRESTOR utilities included in Visual SourceSafe 5.0. With these utilities, you can archive projects, preserve their histories, and restore them to a new database.

2.   You must have SourceSafe Admin privileges to use these utilities

3.   In order to restore a project successfully your archive must include the latest versions all the files in the project. If you use the -v switch with SSARC to archive off earlier versions of your files, you will not be able to restore that archive to a different database because it needs the later versions.

4.   Because the physical file names get renamed when you restore a project to a new database, it may be necessary to reconnect projects that are integrated with Visual SourceSafe.

Warning:

1.   always be very careful when archiving and deleting files

2.   Backing up source files is like voting, do it early and often (warning, this may not be legal in your jurisdiction).

3.   Test your backups out before you actually need them, avoid permanent deletes and keep copies in multiple locations.

 

There are two ways to Archive and Restore Project/Files from one database to another.

To Archive:

1.   Using To archive a database using Visual SourceSafe Administrator

2.   SSARC

Archival of a database allows you to:

* Save disk space on the Visual SourceSafe server or other machine hosting the database.
* Make the Show History command work more quickly.
* Transport files and projects between Visual SourceSafe databases, keeping history information intact.
* Provide a compressed file backing up all or part of a database.

How to Archive Visual SourceSafe (VSS) Project?

Method1: Using Visual SourceSafe Administrator:

The Visual SourceSafe Administrator program allows you to archive your databases using the Archive Projects command, and to restore them from backup using the Restore Projects command.

To archive a database using Visual SourceSafe Administrator:

1. Ensure that no one is using the database and that the ANALYZE utility will not run during the archive operation.
2. Open the database for which you want to archive information.
3. On the Archive menu of Visual SourceSafe Administrator, click Archive Projects.
4. In the Archive wizard, select the project(s) to archive, and click OK.
5. If there are additional projects to be archived, indicate this in step 1 of the wizard, and click Next when finished.
6. In step 2 of the wizard, specify how you want the project(s) to be archived, and click Next when finished. For each choice, you can use Browse to search for and select an archived file to overwrite the existing file.
7. In step 3 of the wizard, specify the versions for the data to archive, using the Version box.
8. Add a comment to the Comment box to document the archive operation.
9. Click Finish to complete the wizard. The archive is written to a *.ssa file in the directory that you have specified.

Method2: Using SSARC: –

Another way of making an archive is to use the Visual SourceSafe SSARC utility from the command line.
Examples

SSARC -d- -yadmin,password archive.ssa $/
Backup the entire default Sourcesafe database to archive.ssa, leaving the database exactly as it is.

SSARC -d- “-vlProduction Release” -yadmin,password -olog.txt archive.ssa $/Test

Backup everything since the version labelled ‘Production Release’ and create a log file with the results of the archiving process.

SSARC -d -x -yadmin,password archive.ssa “$/Project Global Domination” $/OtherProject

Description:  Archive, and delete the deleted files from two projects.

SSARC -i -yadmin,password -olog.txt “-cArchive Everything” archive.ssa $/

Description:  Archive the entire Sourcesafe database, while creating a log file, adding a comment, and running non-interactively, suitable for a scheduled task.
To Restore Project/Files from one database to another.

To Restore:

1.   Using To archive a database using Visual SourceSafe Administrator

2.   SSRESTOR

 

How to Restore Visual SourceSafe(VSS)Project?

Method 1: Using Visual SourceSafe Administrator

Visual SourceSafe Administrator supports restoration of a database from an archive using its Restore Projects command.

To restore a database using Visual SourceSafe Administrator

1. Make sure that no one is using the database and that the ANALYZE utility will not run during the restore operation.
2. On the Archive menu of Visual SourceSafe Administrator, click Restore Projects.
3. In the Restore wizard, enter or locate the archive file from which to restore, and then click Next.
4. In step 2 of the wizard, you can choose the items to restore to the database, and click Next to proceed.
5. Use step 3 of the wizard to specify options for restoring the selected items to the database.
6. Add a comment to the Comment box to document the restore operation.
7. Click Finish to complete the wizard.
8. Verify the database directories carefully to make sure that the restore operation has put the restored items where you intended.

Method 2: Using SSRESTOR Utility

Restores information from a previously created archive. If the restore operation attempts to create a duplicate file or project name, the operation fails. Visual SourcSafe also implements restore operations through its Restore wizard, available in Visual SourceSafe Administrator.
Examples

SSRESTOR -la -yadmin,password archive.ssa $/

Display a list of all of the files archived in archive.ssa.

SSRESTOR “-p$/Test 2” -sD:\newfolder\ -yadmin,password backup.ssa $/Test

Restores project $/Test to the database to a new location, $/Test 2, from the archive file backup.ssa, in a different Sourcesafe database.

Tagged : / / / / / / / / / / / / / / / / / / /

Considerations for Multiple VSS Databases – Pros and Cons

multiple-vss-databases

Microsoft recommends against using multiple VSS databases in simple cases. The support that was in some earlier versions of the product using Data Path doesn’t seem to work at all well in some cases. And at first it can seem that VSS isn’t even capable of operating with multiple databases. On the other hand, there are sometimes good reasons for using multiple VSS databases. And mechanisms for accessing multiple databases ­­sometimes better than the original Data Path mechanism­­ are available in every case (although often poorly documented).
Considerations for Multiple VSS Databases

Pro

  • Quicker maintenance (ANALYZE, backup, etc.) You can for example do detailed maintenance on a different database each day of the week rather than having to do the whole thing all at once.
  • Smaller granularity (In other words you can take a damaged part of VSS down without taking having to take the entire VSS system down.) The current “all or nothing” behavior of VSS is a real thorn in the side of many VSS administrators. In fact this shortcoming alone seems such a “scalability problem” that it makes VSS less than desirable for use in any organization larger than ten people. Multiple VSS databases mitigates this.
  • Perhaps slightly (but not significantly) better performance.
  • Slightly less risk of running into VSS bugs that tend to show up when VSS is stretched beyond its testing and its design center to handle a single very large database.
  • If you have to “restore” a whole database, you at least don’t lose all your organization’s recent work.

Con

  • Potentially a separate list of users for each database, with each user having a separate SS.INI for every database. (One of the configuration recommendations below negates both of these limitations, but maintenance will not be fully automatic. You definitely will have to “add” new users to each database separately, and you may also have to “just remember” to do a few additional manual steps whenever you add or change a VSS user.
  • Separate “user rights” for each database. (It’s very difficult to work around this limitation as the VSS tools for maintaining “user rights” are poor. In fact there’s not even a way to “dump” a “user rights” database to text so you can scan or manipulate it yourself with your own text editing tools.) You could easily wind up facing a maintenance nightmare. One of the configuration recommendations below negates this limitation by simply “not using” user rights at all. You should seriously consider the option of not using “project security”.
  • Microsoft support may blame some hard problems on the multiple databases and say “we told you so”, even if multiple databases really don’t have anything to do with the problem you’re asking them to help with.
  • You cannot “share” files between multiple VSS databases at all. All you can hope for is that your source can be divided into multiple VSS databases along fairly natural project boundaries in such a way that there is virtually no need to “share” files between the multiple databases.
  • It is difficult to bring your multiple databases into one centralized system. The configuration recommendation below of having one unified grand project hierarchy makes this easier. But you will still need to use the Archive and Restore utilities if you need to move a project from one database to another.

 

Tagged : / / / / / / / / / / / / / /

SSARC Utility & SSRESTOR Utility – Archive, Restore VSS Project – Guide

ssarc-utility-ssrestor-utility

Question: 

How to Archive VSS Project in Visual Source Safe (VSS)?

How to Restore VSS Project in  Visual Source Safe (VSS)?

What is SSARC Utility?

What is SSRESTOR Utility?

SSARC Utility

Allows you to archive files, projects, or old versions from a Visual SourceSafe database. Each time you run SSARC (Ssarc.exe), the utility asks only once before it deletes the files/projects. Visual SourceSafe also implements archive operations through its Archive wizard, available in Visual SourceSafe Administrator.

The utility SSRESTOR is used for restoration of archived files. Use of SSARC and SSRESTOR together allows wide-area Visual SourceSafe installations to move files and projects among databases.

Limitation: SSARC cannot create an archive file that is greater than 2 GB. If you try to archive a project larger than this, you will receive an Out of Memory and/or a CRC mismatch error message. To work around this limitation, you will need to archive each subproject.

 

Syntax

ssarc [-C][-D][-I-][-O][-S][-V][-X][-Y] <archive file to create> <files/projects to archive>

If you are not familiar with the syntax conventions used, < and > are used to delimit arguments. The < and > characters are not typed in. The | means a choice of options. Items enclosed in square brackets, [] are optional, and items not enclosed in square brackets are mandatory.

 

Utility Options

The following table describes options available with SSARC.

-C

Specifies a comment (standard Visual SourceSafe parameter). The comment is inserted into the Visual SourceSafe history if the items are deleted from the database as part of the archived record. The comment is also inserted into the archive file itself, if there is one.

-C-

Specifies no comment.

-D

Deletes the archived items from the database.

Specifiying the -d option will delete from your project the items that you are archiving. This will delete your project from Sourcesafe if you use it! Of course, you can restore from your backup file, but for normal use, and for smaller projects I don’t recommend this. This function obviously has its uses, but be sure you want to do this.

-D-

Controls whether Visual SourceSafe actually deletes anything from the database. If this option is not used, the default is to ask.

If the -d- option is used, then SSARC will not delete the projects the items you are archiving. The default is to prompt the user interactively, so if you want to run this from a script, you will need to choose one of the options, or use the -i- flag

-I-

Specifies no prompt for input (standard Visual SourceSafe parameter).

-O

Paginates or redirects output (standard Visual SourceSafe parameter).

-S<srcsafe.ini path>, <data path>

Specifies a path to Srcsafe.ini and the Data directory. The full syntax looks like -Sc: \VSS, OldDB. The item before the comma is the full path to Srcsafe.ini, and the item after the comma is the string in parentheses in a Data_Path setting. If there is no comma, a Srcsafe.ini path is indicated, but no data string. If the first character after the –S is a comma, a data string is specified, but no Srcsafe.ini path.

 

-V[D|L]<version>

Specifies a version number to archive (standard Visual SourceSafe parameter). Enter the version number in standard Visual SourceSafe format (number, date, or label). If this option is not used, SSARC operates on entire files or projects, instead of all versions up to and including a certain version.

Note that SSARC is generally inclusive. That is, if you type –V9, you create an archive file that contains version 9.0 and everything before it. The delete pass is also inclusive, that is, version 9.0 is actually deleted unless it is in the label format. In the latter case, the label is stored in the archive file but is not deleted. If –V is specified, you never delete the current version, even if you specify -D9/9/99. If you are using a version the label format, and the label has a space in it, you must place the entire option in quotation marks, for example, “-VThisOne”.

-X

Archives only deleted items in the specified files and projects. Deleted items are still stored in the Visual SourceSafe database unless the Destroy Permanently option is selected when performing a Delete command.

-X-

Archives all items in the specified files and projects.

-Y<user>,<pwd>

Specifies the user name and password (standard Visual SourceSafe parameter). An example is -YAdmin,Bunny.

archive file to create

Specifies the name of the archive file to create during the archive operation.

files/projects to archive

Specifies files and projects to back up.

Examples

SSARC -d- -yadmin,password archive.ssa $/
Backup the entire default Sourcesafe database to archive.ssa, leaving the database exactly as it is.
SSARC -d- "-vlProduction Release" -yadmin,password -olog.txt archive.ssa $/Test
Backup everything since the version labelled ‘Production Release’ and create a log file with the results of the archiving process.
SSARC -d -x -yadmin,password archive.ssa "$/Project Global Domination" $/OtherProject
Archive, and delete the deleted files from two projects.
SSARC -i -yadmin,password -olog.txt "-cArchive Everything" archive.ssa $/
Archive the entire Sourcesafe database, while creating a log file, adding a comment, and running non-interactively, suitable for a scheduled task.

SSRESTOR Utility

Restores information from a previously created archive. If the restore operation attempts to create a duplicate file or project name, the operation fails. Visual SourcSafe also implements restore operations through its Restore wizard, available in Visual SourceSafe Administrator.

Limitation: SSRESTOR cannot restore a project that is larger than 2 GB. A project larger than this cannot be archived.

 

Syntax:

ssrestor [-C][-I-][-L][-O][-P<project>][-S][-T][-X][-Y]

<archive file to restore> [files/projects]

 

Utility Options

The following table describes options available with this command.

-C

Specifies a comment (standard Visual SourceSafe parameter). The comment is applied to the history entry for restored item(s).

-C-

Specifies no comment.

-I-

Specifies no input (standard Visual SourceSafe parameter).

-L

Specifies a list only, without any restoration.

-LA

Specifies a list of all files and subprojects listed under a project, for example, project $/A.

-O

Redirects output (standard Visual SourceSafe parameter).

-P<project>

Specifies a project to which to restore content. For instance, if you archive $/A/BAR.C and then restore it, it will be restored as $/A/BAR.C.

-S<srcsafe.ini path><data path>

Specifies a path to Srcsafe.ini and the Data directory.

-T

Tests the archive file for corruption, but does not actually restore from the archive.

-X, -X-

Identifies an item that you want to restore, for example, $/a/b. This option distinguishes between deleted projects and undeleted projects that have the same names. For example, if you have deleted $a/b and specify the -X option, SSRESTOR restores the deleted $/a/b. If you specify -X-, SSRESTOR restores an undeleted $/a/b. Even though they have the same name, note that these are two different projects that the utility treats differently.

-Y<user>,<pwd>

Specifies user name and password (standard Visual SourceSafe parameter). An example is -YAdmin,Moggy.

archive file to restore

Specifies the name of the archive file from which to restore the database.

files/projects

Specifies files and projects to restore.

Examples

SSRESTOR -la -yadmin,password archive.ssa $/
Display a list of all of the files archived in archive.ssa.
SSRESTOR "-p$/Test 2" -sD:\newfolder\ -yadmin,password backup.ssa $/Test
Restores project $/Test to the database to a new location, $/Test 2, from the archive file backup.ssa, in a different Sourcesafe database.

Miscellaneous tips

  • Putting the path to the <VSS PATH>\win32 folder in your PATH environment variable makes shell commands a lot easier
  • If you get a message “Only ADMIN can run this utility”, it means that you are either not specifying the admin account, or the password is incorrect. Use "-yadmin,password" if the admin password is “password”, or "-yadmin," if the admin password is not set (not recommended!).
  • If you are using an option that has a space in the argument, enclose the whole thing with quote marks, i.e. “-p$/Project A”
  • A daily archive is easy to do with a Windows shell script, maybe something like this. Then use Scheduled Tasks to have this run every day.
    function q (str)
    	' to make the command a bit more readable, I hope
    	q = """" & str & """"
    end function

    PROJECT = “$/”
    USERID = “admin”
    PASSWORD = “admin”

    ‘ location of SSARC program
    SSARCPATH = “C:\program files\microsoft visual studio\common\vss\win32\ssarc.exe”
    ‘ folder of srcsafe.ini
    SRCSAFEINIPATH = “”
    ‘ prepended to filename in case you’re doing more than one.
    LABEL = “ARCHIVE”
    ‘ destination of archive files
    BACKUPFOLDER = “C:\BACKUPS\”

    ‘ generate a name based on the time.
    today = now()
    backupfilename = LABEL & “-” & formatdatetime(now,2) & “.ssa”

    cmd = q(SSARCPATH) & ” ” & _
    q(“-s” & SRCSAFEINIPATH & “,”) & ” -i- ” & ” -d- ” & _
    q(“-y” & USERID & “,” & PASSWORD) & ” ” & _
    q(BACKUPFOLDER & backupfilename) & ” ” & q(PROJECT)

    Set WshShell = WScript.CreateObject(“WScript.Shell”)
    wscript.echo cmd
    WshShell.run cmd
    set wsshell = nothing

Tagged : / / / / / / / / / / / / / / / / / / / /

How To Create a Unique SRCSAFE.INI File ?

srcsafeini-file
1. Create a new SRCSAFE.INI file and place it in the desired location.
2. If you want include the default SRCSAFE.INI in the unique copy, add the following line:

#INCLUDE <SS path>\SRCSAFE.INI

3. Create the following environment variable:

SET SSDIR=<path to VSS directory>

(such as SET SSDIR = \\MyServer\MyVSSdir)

While it is possible to do this with Visual SourceSafe 5.0, in is not necessary. Simply open the database using file->open.

Tagged : / / / / / / / / / / / / / / /

Understand Ant command line arguments with Examples

ant-command-line-arguments

Several tasks take arguments that will be passed to another process on the command line. To make it easier to specify arguments that contain space characters, nested arg elements can be used.

value – a single command-line argument; can contain space characters.

file – The name of a file as a single command-line argument; will be replaced with the absolute filename of the file.

path – A string that will be treated as a path-like string as a single command-line argument; you can use ; or : as path separators and Ant will convert it to the platform’s local conventions.

pathref – Reference to a path defined elsewhere. Ant will convert it to the platform’s local conventions.

line – a space-delimited list of command-line arguments.

It is highly recommended to avoid the line version when possible. Ant will try to split the command line in a way similar to what a (Unix) shell would do, but may create something that is very different from what you expect under some circumstances.

Examples

<arg value=”-l -a”/>

is a single command-line argument containing a space character.

<arg line=”-l -a”/>

represents two separate command-line arguments.

<arg path=”/dir;/dir2:\dir3″/>

is a single command-line argument with the value \dir;\dir2;\dir3 on DOS-based systems and /dir:/dir2:/dir3 on Unix-like systems.

Command-line Options Summary
ant [options] [target [target2 [target3] …]]

Options:
-help, -h Displays help information describing the Ant command and its options
-projecthelp, -p Print project help information
-version Print the version information and exit
-diagnostics Print information that might be helpful to diagnose or report problems.
-quiet, -q Suppresses most messages not originated by an echo task in the buildfile
-verbose, -v Displays detailed messages for every operation during a build.
-debug, -d Print debugging information
-emacs, -e Produce logging information without adornments
-lib <path> Specifies a path to search for jars and classes
-logfile <file> Use given file for log
-l <file> Use given file for log
-logger <classname> Specifies a class to handle Ant logging.
-listener <classname> Add an instance of class as a project listener
-noinput Do not allow interactive input
-buildfile <file> Use given buildfile
-file <file> Use given buildfile
-f <file> Use given buildfile
-D<property>=<value> Defines a property name-value pair on the command line.
-keep-going, -k execute all targets that do not depend on failed target(s)
-propertyfile <name> load all properties from file with -D properties taking precedence
-inputhandler <class> the class which will handle input requests
-find <file> Search for buildfile towards the root of the filesystem and use it
Tagged : / / / / / / / / / / / / /

ANT Builds and Subversion (SVN) | Ant integration with Subversion guide

ant-builds-and-subversion

As I have mentioned in a previous blog entry, I have come to love using ANT in my development environment. One of the things that I like about it is how well it integrates with my Subversion repository using SVNAnt. If you are not using either ANT or Subversion, you owe it to yourself and your team to check it out.

Here we’ll go over a simple build script that exports application files from the Subversion repository into a local folder in the CFEclipse project. You can then view the following entry on how to ftp that into your production/staging server.
First we need to make sure that your ANT install has the necessary SVNAnt jar files. You can download them here: http://subclipse.tigris.org/svnant.html. Once you unpack the svnant-1.0.0.zip file, you’ll find three jar files: svnant.jar, svnClientAdapter.jar, svnjavahl.jar. Place them on your
[ANTInstall]/lib* folder.

Once you have the jar files in place, you can define them in your build file’s property section like so:
<!– svnant lib –>
<property name=”svnant.lib” value=”lib” />
<property name=”svnant.jar” value=”${svnant.lib}/svnant.jar” />
<property name=”svnClientAdapter.jar” value=”${svnant.lib}/svnClientAdapter.jar” />
<property name=”svnjavahl.jar” value=”${svnant.lib}/svnjavahl.jar” />
Followed by this path definition after all your properties have been defined:

<!– path to the svnant libraries. Usually they will be located in ANT_HOME/lib –>
<path id=”project.classpath”>
<pathelement location=”${svnjavahl.jar}” />
<pathelement location=”${svnant.jar}” />
<pathelement location=”${svnClientAdapter.jar}” />
</path>

Now all you have left to do is add the following task definition:
<!– load the svn task –>
<taskdef resource=”svntask.properties” classpathref=”project.classpath”/>

Now you are all set! You can now call tasks like the following export target:

<!– define properties –>
<!– svn repo url –>
<property name=”svn.url” value=”http://[mysvnhost]/svn/repo/myprojectFiles/” />
<property name=”svn.exportPath” value=”[yourDirectory]:\\[pathToYourCFEclipseProject\\build” />

<target name=”svn.export”>
<echo message=”Exporting application files from svn repository:” />
<input message=”Please enter svn repo username:” addproperty=”svn.username” />
<input message=”Please enter svn repo password:” addproperty=”svn.password” />
<mkdir dir=”${svn.destPath}” />
<svn username=”${svn.username}” password=”${svn.password}”>
<export srcUrl=”${svn.url}” destPath=”${svn.exportPath}” revision=”HEAD” />
</svn>
<echo message=” … finished exporting files.” />
</target>

That’s it. No more running command line tasks to get your subversion commands. For additional info and other SVN tasks you can go to http://subclipse.tigris.org/svnant/svn.html

Tagged : / / / / / / / / / / / / / / / / / / /

How to Use SVN Tasks with ANT ?

svn-tasks-with-ant

This post is about using ANT to perform some of the most common source-control related tasks such as export, tagging, and branching. I am using ANT version 1.7.0 and SVN Ant version 1.1-rc3, bound against Subversion 1.4.0.

The related software can be downloaded here:
1.    SVN Ant = http://subclipse.tigris.org/svnant.html
2.    ANT = http://ant.apache.org/
I shall start with build.properties, which lists a few key/value pairs used in our SVN Ant task build file, referred as svn-tasks.xml:

Content of build.properties:
####START of SVN Properties ####
svn.repository.url=http://xyz.com/repos/somereponame
svn.project.base.path=someprojectname
svn.username=user name to access repo
svn.password=password to access repo
#This shall be name of the tag,
#This property should always be updated before build starts
#This property shall be used to export
tag.name=SOME_TAG_NAME_12222008
#This shall be name of new branch,
#this property should be used only when new branch is to be created
new.branch.name=NEW_BRANCH_12222008
####END of SVN Properties ####
Content of svn-tasks.xml:
<property file=”build.properties”></property>

<!– SVN and SVN-ANT Tasks properties –>
<property name=”svn.repository.url” value=”${svn.repository.url}”/>
<property name=”svn.project.base.path” value=”${svn.project.base.path}” />
<property name=”svn.base.url” value=”${svn.repository.url}/${svn.project.base.path}”/>
<property name=”svnant.lib.dir” location=”svn-ant-lib”/>
<property name=”svnant.javahl” value=”false” />
<property name=”svnant.svnkit” value=”true” />
<!– SVN and SVN-ANT Tasks properties –>

<!– *************************************************************** –>
<!–   Set-Up of SVN-ANT classpath                                   –>
<!– *************************************************************** –>
<path id=”svnant.classpath”>
<fileset dir=”${svnant.lib.dir}”>
<include name=”**/*.jar” />
</fileset>
</path>

<!– *************************************************************** –>
<!–   Loading of SVN task                                           –>
<!– *************************************************************** –>
<typedef resource=”org/tigris/subversion/svnant/svnantlib.xml” classpathref=”svnant.classpath” />

<!– *************************************************************** –>
<!– tool-availability: Determine if SVN-ANT is available.           –>
<!– *************************************************************** –>
<target name=”tool-availability”>
<available resource=”org/tigris/subversion/svnant/svnantlib.xml”
classpathref=”svnant.classpath”
property=”available.svnant”
/>
<echo message=”SVN-ANT is available = ${available.svnant}”/>
</target>

<!– **************************************************************** –>
<!– does-svnant-exist: depends on tool-availablility and     –>
<!–                    displays error message                                   –>
<!– ***************************************************************** –>
<target name=”does-svnant-exist” depends=”tool-availability”>
<fail unless=”available.svnant”>
SVN-ANT is not available, cannot perform tagging or checkout/export svn ant task.
</fail>
</target>

<!– ****************************************************************** –>
<!– svntag: performs tagging using properties from                              –>
<!–         build.properties and uses SVNANT tasks                              –>
<!– ******************************************************************* –>
<target name=”svntag” description=”tags individual project using svnant task”>
<property name=”svn.tag.message” value=”Tagging Project ${project.name} with tag name ${tag.name} from trunk “/>
<property name=”src.url”  value=”${svn.base.url}/${project.name}/trunk/”/>
<property name=”dest.url” value=”${svn.base.url}/${project.name}/tags/${tag.name}”/>

<echo message=”${svn.tag.message}”/>
<echo message=”${src.url}”/>
<echo message=”${dest.url}”/>

<svn javahl=”${svnant.javahl}” svnkit=”${svnant.svnkit}” username=”${svn.username}” password=”${svn.password}”>
<copy srcUrl=”${src.url}” destUrl=”${dest.url}” message=”${svn.tag.message}”/>
</svn>
</target>

<!– ****************************************************************** –>
<!– svnexport: performs export using properties from                            –>
<!–            build.properties and uses SVNANT tasks                           –>
<!– ****************************************************************** –>
<target name=”svnexport” description=”exports individual project using svnant task”>
<property name=”svn.tag.message” value=”Exporting Project ${project.name} with tag name ${tag.name}”/>
<property name=”src.url”  value=”${svn.base.url}/${project.name}/tags/${tag.name}”/>
<property name=”destPath” value=”${dest.path}”/>
<echo message=”${svn.tag.message}”/>
<svn javahl=”${svnant.javahl}” svnkit=”${svnant.svnkit}” username=”${svn.username}” password=”${svn.password}”>
<export srcUrl=”${src.url}” destPath=”${destPath}/${project.name}”/>
</svn>
</target>

<!– ****************************************************************** –>
<!– svnbranch: creates a new branch using properties from                       –>
<!–            build.properties and uses SVNANT tasks                           –>
<!– ****************************************************************** –>
<target name=”svnbranch” description=”creates a new branch for individual project using svnant task”>

<property name=”svn.branch.message” value=”Creating new branch for
Project ${project.name} with new branch name ${new.branch.name} from
trunk”/>
<property name=”src.url”  value=”${svn.base.url}/${project.name}/trunk/”/>
<property name=”dest.url” value=”${svn.base.url}/${project.name}/branches/${new.branch.name}”/>

<echo message=”${svn.branch.message}”/>
<echo message=”${src.url}”/>
<echo message=”${dest.url}”/>

<svn javahl=”${svnant.javahl}” svnkit=”${svnant.svnkit}”
username=”${svn.username}” password=”${svn.password}”>
<copy srcUrl=”${src.url}” destUrl=”${dest.url}” message=”${svn.branch.message}”/>
</svn>
</target>

Link: http://java.dzone.com/articles/how-use-svn-tasks-with-ant

Tagged : / / / / / / / / / / / / / / / / /

Software versioning – What is Build Versioning?

build-versioning

Version:  It is a set of code to which major/minor or a Patch of changes is made. Hence we say a build is released to the QA team for testing. Version is normally the Proper number given for the final package after fixing all issues. Normally in most Cases both numbers, version & build are given in order to release a product.

For example, if you see MSN Messenger About box the version
number is given as:

Skype Version: 3.8.0.139

Now if you check the Version number there are 4 different head for this release. Starting from left 3.8.0 is the main version number, and .139 is the Build number which is linked with Version number.

Build:  It is a set of code in executables to which changes are made which is mile stone, Release candidate or general availability based. Build is a complete setup package which is developed

For Internal use, mostly for QA Purposes, if there are issues then they are fixed and new Build number is given to package.

The resource version number is a structure of two double word values, the Most Significant Value (MSV) and the Least Significant Value (LSV). Each value is broken into two parts, the high word and the low word. In a resource script, this is represented by something like “FILEVERSION 1,0,0,1” or “PRODUCTVERSION 1,0,0,1”.   The “1,0” is the high word/low word of the MSV. The “0,1” is the high word/low word of the LSV. There is also a string representation of the versions in the StringFileInfo block.

Version Number to the Build will be Application Packaging team or the Team in charge of Releasing in most of the situations; sometimes it was also done by the Development Team.

Version number is incremented by one number for each and every release. At the start of the application goes to testing it will start with the version number 1.0. For each and every release, it will be incremented by one.
This is done in the SDLC which follows iterative method. The increment is to indicate that the scheduled changes are done to the system in one version and it is tested, and simultaneously the changes are done to the system in the forthcoming builds and subsequently tested.

The version is not necessarily to be incremented by one number, sometimes it is also incremented in the points, this will happen in the case of Defects found in the current build or testing activity abandoned due to application not stable.

Version number is one of the important things in build release as it keeps track of all changes in the code.

Process:
Once the Dev team develops a build, this is sent to the configuration management team. They maintain a document, of version, the change, module, release details etc. This detail of build is stored in server and viewable by all. So that whenever there is a issue, it is enough if we have a look at the history and pull out that particular version and deliver.

Why do we need?
•    To revert back to old working condition Executables
•    To Maintain the Bug fixes and Enhancement Record with particular label
•    To Keep Track of major/minor or a Patch of changes is made.
•    To have the Process of Achieving Milestone Achieved
•    To have Better Transition between QA, Dev and Release Team
•    To Make the  Build and release process Smooth with milestone achieved.

Tagged : / / / / / / / / / / / / / / / /

What are AntForm / AntMenu? Usage, Installation Process and Examples

antform-antmenu

AntForm is a java tool designed to add interaction to Ant scripts through graphical forms. If you’re new to Ant, start at the Ant site (see website: http://ant.apache.org/). Ant is used extensively used in the java world to automate system-level tasks, mostly (but not exclusively) as a software build system.

Why use AntForm?
Because automation can only be pushed so far until user input is required, the Ant developper will resort to prompting the user for certain property values at runtime. When the number of these properties increases and certain property values become dependant on others, it makes sense to divide the input into a flow of forms. AntForm enables you to do this.
In short, in keeping with the natural evolution of console-to-gui at the language level, AntForm ushers in the present-form paradigm where a read value view existed before.
The goal of the AntForm project is to provide a simple GUI that provides the following:
•    Input forms for modifying properties
•    Button-based menus that launch ant targets

What AntForm does
AntForm provides an Ant task (see usage) for setting property values through a Swing-based form. Properties are presented with a label on the left column and a widget field in the right column, one property per line. Each field component modifies an appointed Ant property when the form is submitted (i.e. the ok button clicked). Properties thus modified can be saved to a specified properties file and/or reused in other tasks. See screenshot

What AntMenu does
AntMenu provides an Ant task (see usage) that sets up a menu in a single vertical column for launching other ant targets. Each link to an Ant target is enabled by a button. See screenshot

Installation
After downloading the package, unzip it into a specific folder on your hard disk. Let’s call this folder AntForm_home for what follows.
In your Ant build file, create taskdef (task definitions) with a classpath referring to your ${antForm_home}/lib/AntForm.jar file, unless this file is copied into the base ${ant_home}/lib folder of your Ant distribution, in which case it doesn’t need to be referenced through the taskdef classpath attribute. The task definitions should look like this:
<taskdef name=”antform” classname=”com.sardak.antform.AntForm”
classpath=”${antform.home}/lib/antform.jar”/>
<taskdef name=”antmenu” classname=”com.sardak.antform.AntMenu”
classpath=”${antform.home}/lib/antform.jar”/>
You can also use the provided taskdefs.properties:
<taskdef resource=”com/sardak/antform/taskdefs.properties”
classpath=”${antform.home}/lib/antform.jar”/>

You’re ready to use the freshly-defined tasks in other ant targets. See AntForm and AntMenu for more information on the specificities if the antform and antmenu tasks.

Samples
There’s a sample and build file named test.xml in the root folder. If your ant_home and path environment variables are correctly set, you should be able to test the samples with the following command:
ant -f test.xml test testmenu testne spinners password wizard1
Use ant -f test.xml -p to see a list of other tests. These tests use other properties or behavioural characteristics and will show you more of what AntForm/AntMenu can do.

AntForm
The following example generates properties for sending a mail.
<antform title=”Send Mail”
save=”properties.txt”
image=”doc/images/testlogo.jpg”>
<label>To send a mail, use the following form. Pick a recipient,
type a subject and a body…the script will do the rest.</label>
<selectionProperty label=”Recipient: ”
property=”recipient”
values=”address1@somewhere.com; address2@somewhere.com; address4@somewhere.com”
separator=”;”/>
<textProperty label=”Subject : ” property=”subject” />
<multilineTextProperty label=”Message body: ”
property=”body”/>
<booleanProperty label=”Send immediately: ” property=”send”/>
</antform>

AntMenu
The following example generates a simple menu.
<antmenu image=”doc/images/logo-small.jpg”
title=”AntForm & AntMenu tests”>
<AntMenuItem name=”AntMenu Tests”>
<AntMenuItem name=”Mail-type form” target=”test”/>
<AntMenuItem name=”Spinners & dateProperty test” target=”spinners”/>
<AntMenuItem name=”Test non-editable properties” target=”testne”/>
<AntMenuItem name=”Login & password test” target=”password”/>
<AntMenuItem name=”AntForm with inner menu test” target=”afm”/>
<AntMenuItem name=”Wizards test” target=”wizard1″/>
</AntMenuItem>
<AntMenuItem name=”AntMenu tests”>
<AntMenuItem name=”This test” target=”testmenu”/>
</AntMenuItem>
<label>A short label with a few explanatory words concerning the menu at hand.</label>
<link label=”Echo 1 target” target=”echo1″/>
<link label=”Echo 2 target” target=”echo2″/>
<link label=”Echo 3 target” target=”echo3″/>
<link label=”End” target=”end”/>
</antmenu>

More Info…
http://antforms.sourceforge.net/

Tagged : / / / / / / / / / / / / / / / /