You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4net-dev@logging.apache.org by bo...@apache.org on 2011/08/20 06:54:10 UTC
svn commit: r1159843 - /logging/log4net/trunk/src/Log4netAssemblyInfo.cs
Author: bodewig
Date: Sat Aug 20 04:54:09 2011
New Revision: 1159843
URL: http://svn.apache.org/viewvc?rev=1159843&view=rev
Log:
Make metadata accessible without reflection
Added:
logging/log4net/trunk/src/Log4netAssemblyInfo.cs (with props)
Added: logging/log4net/trunk/src/Log4netAssemblyInfo.cs
URL: http://svn.apache.org/viewvc/logging/log4net/trunk/src/Log4netAssemblyInfo.cs?rev=1159843&view=auto
==============================================================================
--- logging/log4net/trunk/src/Log4netAssemblyInfo.cs (added)
+++ logging/log4net/trunk/src/Log4netAssemblyInfo.cs Sat Aug 20 04:54:09 2011
@@ -0,0 +1,88 @@
+#region Apache License
+//
+// Licensed to the Apache Software Foundation (ASF) under one or more
+// contributor license agreements. See the NOTICE file distributed with
+// this work for additional information regarding copyright ownership.
+// The ASF licenses this file to you under the Apache License, Version 2.0
+// (the "License"); you may not use this file except in compliance with
+// the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+#endregion
+
+namespace log4net {
+
+ /// <summary>
+ /// Provides information about the environment the assembly has
+ /// been built for.
+ /// </summary>
+ public sealed class AssemblyInfo {
+ /// <summary>Version of the assembly</summary>
+ public const string Version = "1.2.11";
+
+ /// <summary>Version of the framework targeted</summary>
+#if NET_1_1
+ public const decimal TargetFrameworkVersion = 1.1M;
+#elif NET_4_0
+ public const decimal TargetFrameworkVersion = 4.0M;
+#elif NET_2_0 || NETCF_2_0 || MONO_2_0
+#if !CLIENT_PROFILE
+ public const decimal TargetFrameworkVersion = 2.0M;
+#else
+ public const decimal TargetFrameworkVersion = 3.5M;
+#endif // Client Profile
+#else
+ public const decimal TargetFrameworkVersion = 1.0M;
+#endif
+
+ /// <summary>Type of framework targeted</summary>
+#if CLI
+ public const string TargetFramework = "CLI Compatible Frameworks";
+#elif NET
+ public const string TargetFramework = ".NET Framework";
+#elif NETCF
+ public const string TargetFramework = ".NET Compact Framework";
+#elif MONO
+ public const string TargetFramework = "Mono";
+#elif SSCLI
+ public const string TargetFramework = "Shared Source CLI";
+#else
+ public const string TargetFramework = "Unknown";
+#endif
+
+ /// <summary>Does it target a client profile?</summary>
+#if !CLIENT_PROFILE
+ public const bool ClientProfile = false;
+#else
+ public const bool ClientProfile = true;
+#endif
+
+ /// <summary>
+ /// Identifies the version and target for this assembly.
+ /// </summary>
+ public static string Info {
+ get {
+ return string.Format("Apache log4net version {0} compiled for {1}{2} {3}",
+ Version, TargetFramework,
+ /* Can't use
+ ClientProfile && true ? " Client Profile" :
+ or the compiler whines about unreachable expressions
+ */
+#if !CLIENT_PROFILE
+ string.Empty,
+#else
+ " Client Profile",
+#endif
+ TargetFrameworkVersion);
+ }
+ }
+ }
+
+}
Propchange: logging/log4net/trunk/src/Log4netAssemblyInfo.cs
------------------------------------------------------------------------------
svn:eol-style = native