* @see npanday.assembler.AssemblerContext#getAssemblyInfo()
*/
public AssemblyInfo getAssemblyInfo()
{
String basedir = mavenProject.getBasedir().toString();
AssemblyInfo assemblyInfo = new AssemblyInfo();
String description = mavenProject.getDescription();
String version = mavenProject.getVersion();
String name = mavenProject.getName();
Organization org = mavenProject.getOrganization();
String company = ( org != null ) ? org.getName() : "";
String copyright = null;
String informationalVersion = "";
String configuration = "";
File file = new File( basedir + "/COPYRIGHT.txt" );
if ( file.exists() )
{
logger.debug( "NPANDAY-020-000: Found Copyright: " + file.getAbsolutePath() );
FileInputStream fis = null;
try
{
fis = new FileInputStream( file );
copyright = IOUtil.toString( fis ).replace( "\r", " " ).replace( "\n", " " ).replace( "\"", "'" );
}
catch ( IOException e )
{
logger.info( "NPANDAY-020-001: Could not get copyright: File = " + file.getAbsolutePath(), e );
}
finally
{
if ( fis != null )
{
IOUtil.close( fis );
}
}
}
informationalVersion = version;
if ( version.contains( "-" ) )
{
version = version.split( "-" )[0];
}
assemblyInfo.setCompany( company );
assemblyInfo.setCopyright( copyright );
assemblyInfo.setCulture( "" );
assemblyInfo.setDescription( description );
assemblyInfo.setProduct( company + "-" + name );
assemblyInfo.setTitle( name );
assemblyInfo.setTrademark( "" );
assemblyInfo.setInformationalVersion( informationalVersion );
assemblyInfo.setVersion( version );
assemblyInfo.setConfiguration( configuration );
return assemblyInfo;
}