Skip to content

fix(framework): Deprecating old frameworks. #195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion OptimizelySDK.Net40/OptimizelySDK.Net40.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET35;NET40</DefineConstants>
<DefineConstants>TRACE;DEBUG;NET40</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
</PropertyGroup>
<PropertyGroup>
<DefineConstants>;$(DefineConstants);<NETSTANDARD>NetStandardIdentifier</NETSTANDARD>
<DefineConstants>;$(DefineConstants);<NETSTANDARD1_6>NetStandardIdentifier</NETSTANDARD1_6>
</DefineConstants>
</PropertyGroup>
<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions OptimizelySDK/Event/Builder/EventBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

namespace OptimizelySDK.Event.Builder
{
[Obsolete("This class is deprecated. Use 'OptimizelySDK.Event.EventFactory'.")]
public class EventBuilder
{
private const string IMPRESSION_ENDPOINT = "https://logx.optimizely.com/v1/events";
Expand Down
3 changes: 3 additions & 0 deletions OptimizelySDK/Event/Builder/Params.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;

namespace OptimizelySDK.Event.Builder
{
[Obsolete("This class is deprecated.")]
public static class Params
{
public const string ACCOUNT_ID = "account_id";
Expand Down
11 changes: 8 additions & 3 deletions OptimizelySDK/Optimizely.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@

namespace OptimizelySDK
{
#if NET35
[Obsolete("Net3.5 SDK support is deprecated, use NET4.0 or above")]
#elif NETSTANDARD1_6
[Obsolete("Net standard 1.6 SDK support is deprecated, use Net standard 2.0 or above")]
#endif
public class Optimizely : IOptimizely, IDisposable
{
private Bucketer Bucketer;
Expand Down Expand Up @@ -67,7 +72,7 @@ public static String SDK_VERSION
get
{
// Example output: "2.1.0" . Should be kept in synch with NuGet package version.
#if NET35
#if NET35 || NET40
Assembly assembly = Assembly.GetExecutingAssembly();
#else
Assembly assembly = typeof(Optimizely).GetTypeInfo().Assembly;
Expand Down Expand Up @@ -423,7 +428,7 @@ public Variation GetForcedVariation(string experimentKey, string userId)
return DecisionService.GetForcedVariation(experimentKey, userId, config);
}

#region FeatureFlag APIs
#region FeatureFlag APIs

/// <summary>
/// Determine whether a feature is enabled.
Expand Down Expand Up @@ -719,7 +724,7 @@ public List<string> GetEnabledFeatures(string userId, UserAttributes userAttribu
return enabledFeaturesList;
}

#endregion // FeatureFlag APIs
#endregion // FeatureFlag APIs

/// <summary>
/// Validate all string inputs are not null or empty.
Expand Down
2 changes: 1 addition & 1 deletion OptimizelySDK/Utils/Schema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static string GetSchemaJson()
{
if (cache != null)
return cache;
#if NET35
#if NET35 || NET40
var assembly = Assembly.GetExecutingAssembly();
#else
var assembly = typeof(Schema).GetTypeInfo().Assembly;
Expand Down
5 changes: 3 additions & 2 deletions OptimizelySDK/Utils/Validator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static class Validator
/// <param name="configJson">ProjectConfig JSON</param>
/// <param name="schemaJson">Schema JSON for ProjectConfig. If none is provided, use the one already in the project</param>
/// <returns>Whether the ProjectConfig is valid</returns>
#if !NET35
#if !NET35 && !NET40
public static bool ValidateJSONSchema(string configJson, string schemaJson = null)
{
try
Expand All @@ -49,7 +49,8 @@ public static bool ValidateJSONSchema(string configJson, string schemaJson = nul
}
}
#endif
#if NET35

#if NET35 || NET40
public static bool ValidateJSONSchema(string configJson, string schemaJson = null)
{
return true;
Expand Down