/*
 * Licensed 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.
 */
package com.intellij.plugins.haxe.build;

/**
 * Created by ebishton on 4/19/15.
 */
public class IdeaTarget {

  // Loads the string at compile-time from a templatized class.
  public static final String SDK_VERSION_STRING = IdeaSDKIdentifier.BUILD_IDENTIFIER;
  public static final String SDK_TYPE = IdeaSDKIdentifier.BUILD_TYPE;
  public static final int SDK_CODELINE = IdeaSDKIdentifier.BUILD_CODELINE;
  public static final int SDK_BUILD_NUMBER = IdeaSDKIdentifier.BUILD_NUMBER;
  public static final int SDK_BUILD_PATCH = IdeaSDKIdentifier.BUILD_PATCH;

  // Add new constants for specific requirements here.
  // All of these should be boolean constants.  They will
  // be used by the compiler to eliminate dead code, and to
  // allow non-compatible code to exist in the same file.
  //
  // Always use the most generic of the compatibility strings possible.

  public static final boolean IS_VERSION_13_COMPATIBLE = (SDK_CODELINE == 133 || SDK_CODELINE == 135);
  public static final boolean IS_VERSION_13_0_COMPATIBLE = (SDK_CODELINE == 133);
  public static final boolean IS_VERSION_13_1_COMPATIBLE = (SDK_CODELINE == 135);

  public static final boolean IS_VERSION_14_COMPATIBLE = (SDK_CODELINE == 139 || SDK_CODELINE == 141);
  public static final boolean IS_VERSION_14_0_COMPATIBLE = (SDK_CODELINE == 139);
  public static final boolean IS_VERSION_14_1_COMPATIBLE = (SDK_CODELINE == 141);

}

@@ -726,29 +726,30 @@
 d class.%0A  p
-ublic
+rivate
  static fina
@@ -813,29 +813,30 @@
 NTIFIER;%0A  p
-ublic
+rivate
  static fina
@@ -884,29 +884,30 @@
 LD_TYPE;%0A  p
-ublic
+rivate
  static fina
@@ -960,29 +960,30 @@
 ODELINE;%0A  p
-ublic
+rivate
  static fina
@@ -1038,29 +1038,30 @@
 _NUMBER;%0A  p
-ublic
+rivate
  static fina
@@ -1220,10 +1220,41 @@
 ants
-.
  
+resolvable at compile time.%0A  //
  The
@@ -1259,21 +1259,16 @@
 hey will
-%0A  //
  be used
@@ -1383,17 +1383,272 @@
 //%0A  // 
-A
+Specific code inflection points (breaking changes in a codeline)%0A  // that require special handling should be placed here as well, perhaps%0A  // even documenting the change(s) that necessitated the check.%0A  //%0A  // When writing code using these constants, a
 lways us
@@ -1665,16 +1665,21 @@
  generic
+%0A  //
  of the 
@@ -1709,16 +1709,21 @@
 ossible.
+%0A  //
 %0A%0A  publ
@@ -1758,17 +1758,19 @@
 ERSION_1
-3
+5_1
 _COMPATI
@@ -1793,40 +1793,217 @@
 INE 
-== 133 %7C%7C SDK_CODELINE == 135
+%3E= 145);%0A  public static final boolean IS_VERSION_15_0_COMPATIBLE = (SDK_CODELINE %3E= 143);%0A  public static final boolean IS_VERSION_15_COMPATIBLE = (IS_VERSION_15_0_COMPATIBLE %7C%7C IS_VERSION_15_1_COMPATIBLE
 );%0A
+%0A
   pu
@@ -2044,11 +2044,13 @@
 ON_1
-3_0
+4_1_6
 _COM
@@ -2077,17 +2077,133 @@
 INE 
-== 133
+%3E 141 %7C%7C%0A                                                              ( SDK_CODELINE == 141 && SDK_BUILD_NUMBER %3E= 3056)
 );%0A
+%0A
   pu
@@ -2240,17 +2240,17 @@
 ERSION_1
-3
+4
 _1_COMPA
@@ -2275,18 +2275,17 @@
 INE 
-== 135
+%3E= 141
 );%0A
-%0A
   pu
@@ -2324,16 +2324,18 @@
 SION_14_
+0_
 COMPATIB
@@ -2357,40 +2357,135 @@
 INE 
-=
+%3E
 = 139
- %7C%7C SDK_CODELINE == 141
+);%0A  public static final boolean IS_VERSION_14_COMPATIBLE = (IS_VERSION_14_0_COMPATIBLE %7C%7C IS_VERSION_14_1_COMPATIBLE
 );%0A
+%0A
   pu
@@ -2514,35 +2514,35 @@
 ean IS_VERSION_1
-4_0
+3_1
 _COMPATIBLE = (S
@@ -2557,14 +2557,14 @@
 INE 
-=
+%3E
 = 13
-9
+7
 );%0A 
@@ -2596,35 +2596,35 @@
 ean IS_VERSION_1
-4_1
+3_0
 _COMPATIBLE = (S
@@ -2639,16 +2639,132 @@
 INE 
-== 141
+%3E= 135);%0A  public static final boolean IS_VERSION_13_COMPATIBLE = (IS_VERSION_13_0_COMPATIBLE %7C%7C IS_VERSION_13_1_COMPATIBLE
 );%0A
-%0A
 %7D%0A

Add v15 and v14_1_6 build constants.