Running Native Programs in Ant

native-programs-in-ant

Running Native Programs in Ant

Ant, while extremely powerful and flexible, can’t always offer everything you want to do. If this

is the case, you can use the <exec> task, which can run any command-line program.

 The <exec> Task’s Attributes

Attribute Description
appends Sets whether to append the output to the end of a file or overwrite the contents of the file (used in conjunction with output). The default is false.
dir The directory from where the program will be run. The default is null.
error The file to which you want to redirect error messages. The default is the setting in output.
Errorproperty The property where Ant will store error messages. The default is blank.
Executable The command you want to execute. This should be the name of the command and should not be accompanied by any arguments. You specify them with nested <arg> elements. This attribute is required.
failifexecutionfails Tells Ant whether to stop the build if the command fails to start at all. The default is true.
failonerror Tells Ant whether to stop the build if the command exits with a return code other than 0. The default is false.
input The name of a file that will be the input to this command. You can specify only one of input and inputstring. The default is standard input from the console. In addition, you cannot obtain standard input if you set spawn to true.
inputstring A string that will be the input to this command. You can specify only one of input and inputstring. The default is standard input from the console. In addition, you cannot obtain standard input if you set spawn to true.
logError Tells Ant to write error messages to the Ant log files. The error messages will not appear in any output location that you have set. Ant ignores this attribute if you set error or errorproperty. The default is false.
Newenvironment Tells the program to ignore old environment variables if new ones are specified. The default is false.
os Ant will execute the command only if it is running on an operating system in this list. Ant uses String.indexOf() < 0 to see whether the operating system matches anything in this list, so you can specify the operating systems in any format you like, even a continuous string with no separators. The default is to always run the command.
output The file to which you want to redirect output. The default is standard out.
outputproperty The property where Ant will store the output of this command (including error messages unless otherwise redirected). The default is blank.
resolveexecutable Tells Ant to locate the executable in the project’s base directory or the directory specified by dir. The default is false (use the user’s current path).
resultproperty The property where Ant will store the return code of this command. You can use this attribute only if failonerror is false (you’ll find details about this after the table). The default is blank.
searchpath Tells Ant to use the system PATH environment variable to find the command. The default is false.
spawn Tells Ant to start a process that will live after the Ant process has finished. You can’t use error, input, output, or result. The default is false.
timeout The time in milliseconds that Ant should wait before stopping this command. The default is null.
vmlauncher Tells Ant whether to use the JVM’s execution functionality instead of the operating system’s shell. The default is true.
Tagged : / / / / / / / / /

A script to find all users who have not set passwords

a-script-to-find-all-users-who-have-not-set-passwords

Write a script to find all users who have not set passwords.

#!/usr/bin/ruby
require “P4”
p4 = P4.new
p4.parse_forms
p4.connect
p4.run_users.each do
|u|
user = p4.fetch_user( u[ “User” ] )
puts( user[ “User” ] ) unless user.has_key?( “Password” )
end
#!/

OR

#!/usr/bin/perl
use P4;
my $p4 = new P4;
$p4->ParseForms();
$p4->Init() or die( “Can’t connect to Perforce” );
foreach my $u ( $p4->Users() )
{
my $user = $p4->FetchUser( $u->{ “User” } );
print( $user->{ “User” }, “\n” ) unless defined ( $user->{ “Password” }
);
}

Tagged : / / / / / / / /

Script to list the clients in descending access date order

 

script-to-list-the-clients-in-descending-access-date-order

Write a script to list the clients in descending access date order (for deleting obsolete clients).

 

#!/usr/bin/ruby
require “P4”
p4 = P4.new
p4.tagged
p4.connect
clients = p4.run_clients.sort {|a,b| a[ “Access”].to_i <=> b[“Access”].to_i }
clients[0…10].each do
|c|
stamp = Time.at( c[ “Access” ].to_i )
printf( “%-20s %s\n”, c[ “client” ], stamp )
end

OR

#!/usr/bin/perl
use P4;
my $p4 = new P4;
$p4->Tag();
$p4->Init() or die( “Failed to connect to Perforce” );
my @clients = $p4->Clients();
@clients = sort { $a->{ “Access” } <=> $b->{ “Access” } } @clients;
@clients = @clients[ 0..9 ];
foreach my $client ( @clients )
{
last unless defined( $client );
my $stamp = localtime( $client->{ “Access” } );
printf( “%-20s %s\n”, $client->{ “client” }, $stamp );
}

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

Steps to Import Module Process by using WinCVS

wincvs

Import Normally refers to the process of creating a new module in the repository by sending an entire directory structure. Module A directory hierarchy. A software project normally exists as a single module in the repository.

Step 1: Navigate to Remote/Import Module

Step 2: Define Import Filter Operation…

Step 3: Set following basic Import Setting.           

  • Repository Path           
  • Vendor Tag           
  • Release Tag    C
  • VSROOT

Step 4: And press OK. The desired source code will get add in CVS server… 

 

 

 

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

The P4Win Window Navigation | P4Win Navigation Guide

p4win-window-navigation

The P4Win Screen 

The P4Win screen resembles the Windows Explorer. The following diagram points out the main portions of the screen. Each pane is described in detail in the following sections.  

The Depot Pane

Depot contents are displayed in a tree in the left pane.

Picture DepotPane:

Some navigation hints:

Multiple selections: Shift-click to select contiguous items, Ctrl-click to select noncontiguousitems.

Select next/previous: Up and down arrows traverse the current level, and right and leftarrows move the cursor up and down through the folder hierarchy.

Open a selected folder: Use the asterisk (*) key on the numeric keypad.You can control which files are displayed in the depot pane. For example, you might want to restrict the list of files to display only the files for the project you’re working on, or conversely, you might want to see every file in every depot. The scope is controlled by your client specification and the view you choose for the depot pane.

The Right PaneThe right pane displays changelists, jobs, client specifications, users, labels or branch specifications. To change the display, click the corresponding toolbar button.  

The ToolbarThe P4Win toolbar contains buttons that provide shortcuts for common P4Winoperations. However, there’s a menu equivalent for every button on the toolbar. Note that buttons are gray if an operation is not available. For example, some operations require you to select a file first. If no file is selected, the button (and the corresponding menu item)are gray. Here’s what the buttons do: 

 

The Status PaneIn the status pane at the bottom of the screen, P4Win displays the commands it sends to the Perforce server, the results of operations, and, for some P4Win operations, lists ofinformation.  

P4Win FormsTo define changelists, users, workspaces, labels, jobs, and branches, you enter information into forms displayed by P4Win. For example, the following figure shows the changelistform.  

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

Perforce Specifications | Perforce Features | Perforce Details

perforce-specifications

Perforce Specifications In addition to files, P4Win lets you manage specifications that define the following Perforce entities:

 

Tagged : / / / / / / / / /

Perforce Basic Concepts | Perforce Overview | What is Perforce ?

perforce-basic-concepts

Perforce Basic

connects to a Perforce server to move files between Perforce depots and yourworkspace, as shown below. 

The precise definitions for these Perforce terms are as follows:depot: a file repository on the Perforce server. It contains all existing versions of all files ever submitted to the server. There can be multiple depots on a single server. Theexamples in this guide show a single depot.server: the program that executes the commands sent by client programs, maintains depot files, and tracks the state of workspaces.workspace: folders on the client computer where you work on revisions of files that are managed by Perforce.

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