/**
* @see org.apache.maven.dotnet.assembler.AssemblerContext#getAssemblyInfo()
*/
public AssemblyInfo getAssemblyInfo()
{
AssemblyInfo assemblyInfo = new AssemblyInfo();
String description = mavenProject.getDescription();
String version = mavenProject.getVersion();
String name = mavenProject.getName();
Organization organization = mavenProject.getOrganization();
String company = ( organization != null ) ? organization.getName() : "";
String copyright = null;
String informationalVersion = "";
String configuration = "";
String basedir = mavenProject.getBasedir().toString();
File file = new File( basedir + "/COPYRIGHT.txt" );
if ( file.exists() )
{
logger.log( Level.INFO, "NMAVEN-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.warning( "NMAVEN-020-001: Could not get copyright: File = " + file.getAbsolutePath() );
}
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;
}