|
| 1 | +--- |
| 2 | +layout: default |
| 3 | +title: Compatible Strategy |
| 4 | +nav_order: 6 |
| 5 | +parent: Development |
| 6 | +--- |
| 7 | + |
| 8 | +In JetBrains' IDE, it is important to note that APIs can undergo changes, leading to potential incompatibility issues |
| 9 | +between the plugin and the latest IDE versions. To address this, it is necessary to configure a compatibility strategy |
| 10 | +for the plugin. |
| 11 | + |
| 12 | +Within AutoDev, we employ the following strategies: |
| 13 | + |
| 14 | +1. **Latest APIs:** We support versions 233 to 241 and beyond, representing JetBrains' IDEs where AI plugin development |
| 15 | + began. |
| 16 | + |
| 17 | +2. **Stable APIs:** Our compatibility extends to versions 222 to 232, which are widely utilized within enterprise |
| 18 | + environments and ensure stability. |
| 19 | + |
| 20 | +By adopting these strategies, we aim to enhance the plugin's compatibility with various JetBrains IDE versions, catering |
| 21 | +to both cutting-edge and established enterprise development environments. |
| 22 | + |
| 23 | +## Gradle Configuration for Compatibility |
| 24 | + |
| 25 | +To ensure compatibility with different IDE versions, we can configure the plugin in the Gradle config, such as |
| 26 | +`gradle.properties`: |
| 27 | + |
| 28 | +```properties |
| 29 | +# Supported platforms: 222, 233 |
| 30 | +platformVersion=233 |
| 31 | +``` |
| 32 | + |
| 33 | +By specifying the platform version, we can ensure that the plugin is compatible with the desired IDE versions. |
| 34 | + |
| 35 | +### Platform Version Configuration |
| 36 | + |
| 37 | +According to the different platform versions, we can configure the plugin by `gradle-{version}.properties`. |
| 38 | +For example, in `gradle-222.properties`: |
| 39 | + |
| 40 | +```properties |
| 41 | +pluginSinceBuild=222.* |
| 42 | +pluginUntilBuild=232.* |
| 43 | +``` |
| 44 | + |
| 45 | +### Gradle SourceSets |
| 46 | + |
| 47 | +We can also configure the plugin in the Gradle source sets, such as `src/main/{version}/kotlin` in `build.gradle.kts`: |
| 48 | + |
| 49 | +```kotlin |
| 50 | +allprojects { |
| 51 | + // ... |
| 52 | + sourceSets { |
| 53 | + main { |
| 54 | + java.srcDirs("src/gen") |
| 55 | + resources.srcDirs("src/$platformVersion/main/resources") |
| 56 | + } |
| 57 | + test { |
| 58 | + resources.srcDirs("src/$platformVersion/test/resources") |
| 59 | + } |
| 60 | + } |
| 61 | + kotlin { |
| 62 | + sourceSets { |
| 63 | + main { |
| 64 | + kotlin.srcDirs("src/$platformVersion/main/kotlin") |
| 65 | + } |
| 66 | + test { |
| 67 | + kotlin.srcDirs("src/$platformVersion/test/kotlin") |
| 68 | + } |
| 69 | + } |
| 70 | + } |
| 71 | + // ... |
| 72 | +} |
| 73 | +``` |
| 74 | + |
| 75 | +By configuring the plugin in the Gradle source sets, we can ensure that the plugin is compatible with different IDE |
| 76 | +versions, catering to both cutting-edge and established enterprise development environments. |
0 commit comments