Skip to content

Commit a677482

Browse files
authored
Add AssemblyNativeVersionAttribute (#67)
***NO_CI***
1 parent ae7be89 commit a677482

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

source/nanoFramework.CoreLibrary/CoreLibrary.nfproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,9 @@
313313
<NFMDP_PE_ExcludeClassByName Include="System.Reflection.AssemblyVersionAttribute">
314314
<InProject>false</InProject>
315315
</NFMDP_PE_ExcludeClassByName>
316+
<NFMDP_PE_ExcludeClassByName Include="System.Reflection.AssemblyNativeVersionAttribute">
317+
<InProject>false</InProject>
318+
</NFMDP_PE_ExcludeClassByName>
316319
<NFMDP_PE_ExcludeClassByName Include="System.Reflection.DefaultMemberAttribute">
317320
<InProject>false</InProject>
318321
</NFMDP_PE_ExcludeClassByName>

source/nanoFramework.CoreLibrary/System/AssemblyInfo2.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66

77
using System;
88
using System.Reflection;
9+
using System.Runtime.CompilerServices;
910

1011
[assembly: CLSCompliant(true)]
1112
[assembly: AssemblyTitle("mscorlib")]
1213
[assembly: AssemblyCompany("nanoFramework Contributors")]
1314
[assembly: AssemblyProduct("nanoFramework mscorlib")]
1415
[assembly: AssemblyCopyright("Copyright © nanoFramework Contributors 2017")]
16+
17+
[assembly: AssemblyNativeVersion("1.1.1.")]

source/nanoFramework.CoreLibrary/System/Reflection/AssemblyAttributes.cs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,4 +226,37 @@ public String Version
226226
get { return _version; }
227227
}
228228
}
229+
230+
/// <summary>
231+
/// Defines the required native version required for an assembly.
232+
/// At deploy time this is used to check if the target device has the correct native version to support this assembly.
233+
/// </summary>
234+
/// <remarks>
235+
/// This attribute is specific of nanoFramework.
236+
/// </remarks>
237+
[AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class, Inherited = false)]
238+
public sealed class AssemblyNativeVersionAttribute : Attribute
239+
{
240+
private readonly String _nativeVersion;
241+
242+
/// <summary>
243+
/// Initializes a new instance of the AssemblyNativeVersionAttribute class.
244+
/// </summary>
245+
/// <param name="version">The native version required for the assembly.</param>
246+
public AssemblyNativeVersionAttribute(String version)
247+
{
248+
_nativeVersion = version;
249+
}
250+
251+
/// <summary>
252+
/// Gets the native version required for the assembly.
253+
/// </summary>
254+
/// <value>
255+
/// A string containing the native version.
256+
/// </value>
257+
public String NativeVersion
258+
{
259+
get { return _nativeVersion; }
260+
}
261+
}
229262
}

0 commit comments

Comments
 (0)