Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
OpenSourceSignProcessor.cs
Go to the documentation of this file.
1 using Mono.Cecil;
2 
3 namespace SiliconStudio.AssemblyProcessor
4 {
6  {
7  public bool Process(AssemblyProcessorContext context)
8  {
9  var assembly = context.Assembly;
10 
11  // Only process if there is a public key
12  if (!assembly.Name.HasPublicKey)
13  return false;
14 
15  // Check if already strong signed
16  if ((assembly.MainModule.Attributes & ModuleAttributes.StrongNameSigned) == ModuleAttributes.StrongNameSigned)
17  return false;
18 
19  // We have a delay signed assembly that is not strong name signed yet.
20  // Let's strong sign it now (a.k.a. OSS, OpenSourceSign)
21  // Note: Maybe we should make sure it's actually Paradox key?
22  assembly.MainModule.Attributes |= ModuleAttributes.StrongNameSigned;
23 
24  return true;
25  }
26  }
27 }