Skip to content

Commit 03261a7

Browse files
msohailhussainMichael Ng
authored andcommitted
fix(framework): Deprecating old frameworks. (#195)
1 parent d2f8eb7 commit 03261a7

File tree

7 files changed

+18
-8
lines changed

7 files changed

+18
-8
lines changed

OptimizelySDK.Net40/OptimizelySDK.Net40.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<DebugType>full</DebugType>
2020
<Optimize>false</Optimize>
2121
<OutputPath>bin\Debug\</OutputPath>
22-
<DefineConstants>TRACE;DEBUG;NET35;NET40</DefineConstants>
22+
<DefineConstants>TRACE;DEBUG;NET40</DefineConstants>
2323
<ErrorReport>prompt</ErrorReport>
2424
<WarningLevel>4</WarningLevel>
2525
</PropertyGroup>

OptimizelySDK.NetStandard16/OptimizelySDK.NetStandard16.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
1111
</PropertyGroup>
1212
<PropertyGroup>
13-
<DefineConstants>;$(DefineConstants);<NETSTANDARD>NetStandardIdentifier</NETSTANDARD>
13+
<DefineConstants>;$(DefineConstants);<NETSTANDARD1_6>NetStandardIdentifier</NETSTANDARD1_6>
1414
</DefineConstants>
1515
</PropertyGroup>
1616
<ItemGroup>

OptimizelySDK/Event/Builder/EventBuilder.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
namespace OptimizelySDK.Event.Builder
2525
{
26+
[Obsolete("This class is deprecated. Use 'OptimizelySDK.Event.EventFactory'.")]
2627
public class EventBuilder
2728
{
2829
private const string IMPRESSION_ENDPOINT = "https://logx.optimizely.com/v1/events";

OptimizelySDK/Event/Builder/Params.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
using System;
17+
1618
namespace OptimizelySDK.Event.Builder
1719
{
20+
[Obsolete("This class is deprecated.")]
1821
public static class Params
1922
{
2023
public const string ACCOUNT_ID = "account_id";

OptimizelySDK/Optimizely.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030

3131
namespace OptimizelySDK
3232
{
33+
#if NET35
34+
[Obsolete("Net3.5 SDK support is deprecated, use NET4.0 or above")]
35+
#elif NETSTANDARD1_6
36+
[Obsolete("Net standard 1.6 SDK support is deprecated, use Net standard 2.0 or above")]
37+
#endif
3338
public class Optimizely : IOptimizely, IDisposable
3439
{
3540
private Bucketer Bucketer;
@@ -67,7 +72,7 @@ public static String SDK_VERSION
6772
get
6873
{
6974
// Example output: "2.1.0" . Should be kept in synch with NuGet package version.
70-
#if NET35
75+
#if NET35 || NET40
7176
Assembly assembly = Assembly.GetExecutingAssembly();
7277
#else
7378
Assembly assembly = typeof(Optimizely).GetTypeInfo().Assembly;
@@ -423,7 +428,7 @@ public Variation GetForcedVariation(string experimentKey, string userId)
423428
return DecisionService.GetForcedVariation(experimentKey, userId, config);
424429
}
425430

426-
#region FeatureFlag APIs
431+
#region FeatureFlag APIs
427432

428433
/// <summary>
429434
/// Determine whether a feature is enabled.
@@ -719,7 +724,7 @@ public List<string> GetEnabledFeatures(string userId, UserAttributes userAttribu
719724
return enabledFeaturesList;
720725
}
721726

722-
#endregion // FeatureFlag APIs
727+
#endregion // FeatureFlag APIs
723728

724729
/// <summary>
725730
/// Validate all string inputs are not null or empty.

OptimizelySDK/Utils/Schema.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public static string GetSchemaJson()
2626
{
2727
if (cache != null)
2828
return cache;
29-
#if NET35
29+
#if NET35 || NET40
3030
var assembly = Assembly.GetExecutingAssembly();
3131
#else
3232
var assembly = typeof(Schema).GetTypeInfo().Assembly;

OptimizelySDK/Utils/Validator.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static class Validator
3232
/// <param name="configJson">ProjectConfig JSON</param>
3333
/// <param name="schemaJson">Schema JSON for ProjectConfig. If none is provided, use the one already in the project</param>
3434
/// <returns>Whether the ProjectConfig is valid</returns>
35-
#if !NET35
35+
#if !NET35 && !NET40
3636
public static bool ValidateJSONSchema(string configJson, string schemaJson = null)
3737
{
3838
try
@@ -49,7 +49,8 @@ public static bool ValidateJSONSchema(string configJson, string schemaJson = nul
4949
}
5050
}
5151
#endif
52-
#if NET35
52+
53+
#if NET35 || NET40
5354
public static bool ValidateJSONSchema(string configJson, string schemaJson = null)
5455
{
5556
return true;

0 commit comments

Comments
 (0)