#!/usr/bin/perl
#
# Jar files containing Java Beans require a manifest file describing those
# beans to correctly function.  This file parses the comment headers of your
# java source files, looking for "manifest:" directives indicating
# what data, if any, should be placed in the manifest for the particular
# object described by that source file.  The output of this process
# should be placed in a manifest file to be added to the jar file.
#
# Bryan Horling - 27 April 1998
# ########################################################################

# Print the main-class
print "Main-Class: agent.mass.Control\n";

# Args
while ($_ = shift @ARGV) {
	&MakeManifest($_);
}

sub MakeManifest {
	local($FILE) = @_;
	local($FLAG) = 0;

	# Read it in
	open(FILE, $FILE) ||
		warn "Problem opening $FILE ($!).\n";
	while(<FILE>) {
		next unless (/^[^#]*manifest:/i);
		$_ =~ s/.*manifest:\s*//;
		print;
		$FLAG++;
	}
	print "\n" if ($FLAG);
	close(FILE);
}
