From 7211bf3f869295394c9e912247795c7b4a4a8ce3 Mon Sep 17 00:00:00 2001 From: Denis Fokin Date: Fri, 7 Oct 2022 16:30:51 +0300 Subject: [PATCH 1/5] Enable android support in kts --- gradle.properties | 5 +++++ utbot-intellij/build.gradle.kts | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index bfed176dd4..bf84459c26 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,8 +1,13 @@ kotlin.code.style=official # IU, IC, PC, PY, WS... +# AS for AndroidStudio ideType=IC +# In order to run Android Studion instead of community, please, specify the path to your installation +# of AndroidStudio IDE +androidStudioPath=C:/Program Files/Android/Android Studio + pythonCommunityPluginVersion=222.4167.37 #Version numbers: https://plugins.jetbrains.com/plugin/631-python/versions pythonUltimatePluginVersion=222.4167.37 diff --git a/utbot-intellij/build.gradle.kts b/utbot-intellij/build.gradle.kts index 4d5571c915..8a73fca300 100644 --- a/utbot-intellij/build.gradle.kts +++ b/utbot-intellij/build.gradle.kts @@ -8,6 +8,10 @@ val pythonUltimatePluginVersion: String? by rootProject val sootCommitHash: String? by rootProject val kryoVersion: String? by rootProject val semVer: String? by rootProject +val androidStudioPath: String? by rootProject + +// https://plugins.jetbrains.com/docs/intellij/android-studio.html#configuring-the-plugin-pluginxml-file +val ideTypeOrAndroidStudio = if (androidStudioPath == null) ideType else "IC" plugins { id("org.jetbrains.intellij") version "1.7.0" @@ -40,12 +44,13 @@ intellij { "IU" -> jvmPlugins + pythonUltimatePlugins + jsPlugins + androidPlugins "PC" -> pythonCommunityPlugins "PU" -> pythonUltimatePlugins // something else, JS? + "AS" -> jvmPlugins + androidPlugins else -> jvmPlugins } ) version.set("222.4167.29") - type.set(ideType) + type.set(ideTypeOrAndroidStudio) } tasks { @@ -64,6 +69,7 @@ tasks { runIde { jvmArgs("-Xmx2048m") + androidStudioPath?.let { ideDir.set(file(it)) } } patchPluginXml { From 3ad71c69a91192735da61ce40f30ffcfe052787b Mon Sep 17 00:00:00 2001 From: Denis Fokin Date: Fri, 7 Oct 2022 16:46:56 +0300 Subject: [PATCH 2/5] Get rid of AS. Use the path only --- utbot-intellij/build.gradle.kts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/utbot-intellij/build.gradle.kts b/utbot-intellij/build.gradle.kts index 8a73fca300..0b0f35d7b2 100644 --- a/utbot-intellij/build.gradle.kts +++ b/utbot-intellij/build.gradle.kts @@ -21,11 +21,13 @@ intellij { val androidPlugins = listOf("org.jetbrains.android") - val jvmPlugins = listOf( + val jvmPlugins = mutableListOf( "java", "org.jetbrains.kotlin:222-1.7.20-release-201-IJ4167.29" ) + androidStudioPath?.let { jvmPlugins += androidPlugins } + val pythonCommunityPlugins = listOf( "PythonCore:${pythonCommunityPluginVersion}" ) @@ -44,7 +46,6 @@ intellij { "IU" -> jvmPlugins + pythonUltimatePlugins + jsPlugins + androidPlugins "PC" -> pythonCommunityPlugins "PU" -> pythonUltimatePlugins // something else, JS? - "AS" -> jvmPlugins + androidPlugins else -> jvmPlugins } ) From cb89f7d90b3f2cc765521289937f3eabd7122f8d Mon Sep 17 00:00:00 2001 From: Denis Fokin Date: Fri, 7 Oct 2022 16:48:06 +0300 Subject: [PATCH 3/5] Better naming --- gradle.properties | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index bf84459c26..8ead74492b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,8 +4,9 @@ kotlin.code.style=official # AS for AndroidStudio ideType=IC -# In order to run Android Studion instead of community, please, specify the path to your installation -# of AndroidStudio IDE +# In order to run Android Studion instead of community, please, specify the path +# to your Android Studio installation + androidStudioPath=C:/Program Files/Android/Android Studio pythonCommunityPluginVersion=222.4167.37 From 02c65ec23760ea6397494e0cfaecae602cc99cc4 Mon Sep 17 00:00:00 2001 From: Egor Kulikov Date: Mon, 10 Oct 2022 10:44:50 +0300 Subject: [PATCH 4/5] Corrected comment --- gradle.properties | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 8ead74492b..bf2c3a6e11 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,13 +1,13 @@ kotlin.code.style=official # IU, IC, PC, PY, WS... -# AS for AndroidStudio +# IC for AndroidStudio ideType=IC # In order to run Android Studion instead of community, please, specify the path # to your Android Studio installation -androidStudioPath=C:/Program Files/Android/Android Studio +androidStudioPath=D:/AS2021 pythonCommunityPluginVersion=222.4167.37 #Version numbers: https://plugins.jetbrains.com/plugin/631-python/versions From c4c0529d1725794672f12cfbd162562ec221d74f Mon Sep 17 00:00:00 2001 From: Egor Kulikov Date: Mon, 10 Oct 2022 11:04:14 +0300 Subject: [PATCH 5/5] Commented Android Studio for other users --- gradle.properties | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index bf2c3a6e11..5cf79d2a49 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,10 +4,9 @@ kotlin.code.style=official # IC for AndroidStudio ideType=IC -# In order to run Android Studion instead of community, please, specify the path -# to your Android Studio installation - -androidStudioPath=D:/AS2021 +# In order to run Android Studion instead of Intellij Community, +# specify the path to your Android Studio installation +//androidStudioPath=D:/AS2021 pythonCommunityPluginVersion=222.4167.37 #Version numbers: https://plugins.jetbrains.com/plugin/631-python/versions