From 55291ea10c68868097d07c0643f17685761ce48f Mon Sep 17 00:00:00 2001 From: Egor Kulikov Date: Mon, 17 Jul 2023 17:28:01 +0300 Subject: [PATCH 01/10] It builds with ProjectType==Standard --- gradle.properties | 8 ++++ settings.gradle.kts | 52 +++++++++++++++----------- utbot-framework/build.gradle | 19 ++++++---- utbot-instrumentation/build.gradle.kts | 7 +++- utbot-intellij/build.gradle.kts | 20 +++++++--- utbot-rd/build.gradle | 41 ++++++++++---------- 6 files changed, 94 insertions(+), 53 deletions(-) diff --git a/gradle.properties b/gradle.properties index d92ad7cf52..537d34d80f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,13 @@ kotlin.code.style=official +#Project Type +# - Standard: for Java + { Python, JavaScript, Go } +# - Spring: for Java + Spring +projectType=Standard + +standardProjectTypeName=Standard +springProjectTypeName=Spring + # IU, IC, PC, PY # IC for AndroidStudio ideType=IC diff --git a/settings.gradle.kts b/settings.gradle.kts index aa4bc94058..496c866381 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,3 +1,7 @@ +val projectType: String by settings +val standardProjectTypeName: String by settings +val springProjectTypeName: String by settings + val ideType: String by settings val buildType: String by settings @@ -50,30 +54,36 @@ if (includeRiderInBuild.toBoolean()) { } include("utbot-ui-commons") +include("utbot-spring-commons-api") -if (pythonIde.split(",").contains(ideType)) { - include("utbot-python") - include("utbot-cli-python") - include("utbot-intellij-python") - include("utbot-python-parser") -} +when (projectType) { + standardProjectTypeName -> { + if (pythonIde.split(",").contains(ideType)) { + include("utbot-python") + include("utbot-cli-python") + include("utbot-intellij-python") + include("utbot-python-parser") + } -if (jsBuild == buildType || jsIde.split(",").contains(ideType)) { - include("utbot-js") - include("utbot-cli-js") - include("utbot-intellij-js") -} + if (jsBuild == buildType || jsIde.split(",").contains(ideType)) { + include("utbot-js") + include("utbot-cli-js") + include("utbot-intellij-js") + } -if (goIde.split(",").contains(ideType)) { - include("utbot-go") - include("utbot-cli-go") - include("utbot-intellij-go") -} + if (goIde.split(",").contains(ideType)) { + include("utbot-go") + include("utbot-cli-go") + include("utbot-intellij-go") + } + } -include("utbot-spring-analyzer") -include("utbot-spring-commons") -include("utbot-spring-commons-api") + springProjectTypeName -> { + include("utbot-spring-analyzer") + include("utbot-spring-commons") + include("utbot-spring-sample") + include("utbot-spring-test") + } +} -include("utbot-spring-sample") -include("utbot-spring-test") diff --git a/utbot-framework/build.gradle b/utbot-framework/build.gradle index 649a06b4ef..9f9ccea543 100644 --- a/utbot-framework/build.gradle +++ b/utbot-framework/build.gradle @@ -15,8 +15,6 @@ dependencies { api project(':utbot-framework-api') api project(':utbot-rd') - implementation project(':utbot-spring-commons-api') - implementation group: 'com.jetbrains.rd', name: 'rd-framework', version: rdVersion implementation group: 'com.jetbrains.rd', name: 'rd-core', version: rdVersion @@ -46,17 +44,24 @@ dependencies { implementation group: 'com.github.UnitTestBot.ksmt', name: 'ksmt-core', version: ksmtVersion implementation group: 'com.github.UnitTestBot.ksmt', name: 'ksmt-z3', version: ksmtVersion - implementation project(':utbot-spring-analyzer') - fetchSpringAnalyzerJar project(path: ':utbot-spring-analyzer', configuration: 'springAnalyzerJar') fetchInstrumentationJar project(path: ':utbot-instrumentation', configuration: 'instrumentationArchive') + + if (projectType == springProjectTypeName) { + implementation project(':utbot-spring-commons-api') + implementation project(':utbot-spring-analyzer') + fetchSpringAnalyzerJar project(path: ':utbot-spring-analyzer', configuration: 'springAnalyzerJar') + } } processResources { - from(configurations.fetchSpringAnalyzerJar) { - into "lib" - } from(configurations.fetchInstrumentationJar) { into "lib" } + + if (projectType == springProjectTypeName) { + from(configurations.fetchSpringAnalyzerJar) { + into "lib" + } + } } diff --git a/utbot-instrumentation/build.gradle.kts b/utbot-instrumentation/build.gradle.kts index 1c839dd570..4feb0aa055 100644 --- a/utbot-instrumentation/build.gradle.kts +++ b/utbot-instrumentation/build.gradle.kts @@ -1,5 +1,8 @@ import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer +val projectType: String by rootProject +val springProjectTypeName: String by rootProject + val asmVersion: String by rootProject val kryoVersion: String by rootProject val kryoSerializersVersion: String by rootProject @@ -58,7 +61,9 @@ dependencies { implementation("org.mockito:mockito-core:$mockitoVersion") implementation("org.mockito:mockito-inline:$mockitoInlineVersion") - fetchSpringCommonsJar(project(":utbot-spring-commons", configuration = "springCommonsJar")) + if (projectType == springProjectTypeName) { + fetchSpringCommonsJar(project(":utbot-spring-commons", configuration = "springCommonsJar")) + } } /** diff --git a/utbot-intellij/build.gradle.kts b/utbot-intellij/build.gradle.kts index d7b6525a2b..f381c05a0d 100644 --- a/utbot-intellij/build.gradle.kts +++ b/utbot-intellij/build.gradle.kts @@ -1,3 +1,7 @@ +val projectType: String by rootProject +val standardProjectTypeName: String by rootProject +val springProjectTypeName: String by rootProject + val intellijPluginVersion: String? by rootProject val kotlinLoggingVersion: String? by rootProject val apacheCommonsTextVersion: String? by rootProject @@ -60,11 +64,17 @@ intellij { ) plugins.set( - when (ideType) { - "IC" -> jvmPlugins + pythonCommunityPlugins + androidPlugins + mavenUtilsPlugins - "IU" -> jvmPlugins + pythonUltimatePlugins + jsPlugins + goPlugins + androidPlugins + mavenUtilsPlugins - "PC" -> pythonCommunityPlugins - "PY" -> pythonUltimatePlugins // something else, JS? + when (projectType) { + standardProjectTypeName -> { + when (ideType) { + "IC" -> jvmPlugins + pythonCommunityPlugins + androidPlugins + mavenUtilsPlugins + "IU" -> jvmPlugins + pythonUltimatePlugins + jsPlugins + goPlugins + androidPlugins + mavenUtilsPlugins + "PC" -> pythonCommunityPlugins + "PY" -> pythonUltimatePlugins // something else, JS? + else -> jvmPlugins + } + } + springProjectTypeName -> jvmPlugins else -> jvmPlugins } ) diff --git a/utbot-rd/build.gradle b/utbot-rd/build.gradle index 7f375a837e..e511fce888 100644 --- a/utbot-rd/build.gradle +++ b/utbot-rd/build.gradle @@ -257,31 +257,34 @@ task generateCommonModels(type: RdGenTask) { } } -task generateSpringModels(type: RdGenTask) { - def currentProjectDir = project.projectDir - def ideaPluginProjectDir = project.rootProject.childProjects["utbot-spring-analyzer"].projectDir - def generatedOutputDir = new File(ideaPluginProjectDir, "src/main/kotlin/org/utbot/spring/generated") - def hashDir = generatedOutputDir - def sourcesDir = new File(currentProjectDir, "src/main/rdgen/org/utbot/rd/models") - def rdParams = extensions.getByName("params") as RdGenExtension +if (projectType == springProjectTypeName) { + task generateSpringModels(type: RdGenTask) { + def currentProjectDir = project.projectDir + def ideaPluginProjectDir = project.rootProject.childProjects["utbot-spring-analyzer"].projectDir + def generatedOutputDir = new File(ideaPluginProjectDir, "src/main/kotlin/org/utbot/spring/generated") + def hashDir = generatedOutputDir + def sourcesDir = new File(currentProjectDir, "src/main/rdgen/org/utbot/rd/models") + def rdParams = extensions.getByName("params") as RdGenExtension - group = "rdgen" - rdParams.verbose = true - rdParams.sources(sourcesDir) - rdParams.hashFolder = hashDir.canonicalPath - // where to search roots - rdParams.packages = "org.utbot.rd.models" + group = "rdgen" + rdParams.verbose = true + rdParams.sources(sourcesDir) + rdParams.hashFolder = hashDir.canonicalPath + // where to search roots + rdParams.packages = "org.utbot.rd.models" - rdParams.generator { - language = "kotlin" - transform = "symmetric" - root = "org.utbot.rd.models.SpringAnalyzerRoot" + rdParams.generator { + language = "kotlin" + transform = "symmetric" + root = "org.utbot.rd.models.SpringAnalyzerRoot" - directory = generatedOutputDir.canonicalPath - namespace = "org.utbot.spring.generated" + directory = generatedOutputDir.canonicalPath + namespace = "org.utbot.spring.generated" + } } } + task generateCSharpModels(type: RdGenTask) { def currentProjectDir = project.projectDir def riderPluginProjectDir = project.rootProject.projectDir.toPath().resolve("utbot-rider").toFile() From 697565b13fc45b4f6dee3ba581b03c556b181847 Mon Sep 17 00:00:00 2001 From: Egor Kulikov Date: Mon, 17 Jul 2023 17:33:37 +0300 Subject: [PATCH 02/10] It builds with ProjectType==Spring --- utbot-intellij/build.gradle.kts | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/utbot-intellij/build.gradle.kts b/utbot-intellij/build.gradle.kts index f381c05a0d..eb1c486d3f 100644 --- a/utbot-intellij/build.gradle.kts +++ b/utbot-intellij/build.gradle.kts @@ -161,19 +161,21 @@ dependencies { implementation(project(":utbot-ui-commons")) //Family - if (pythonIde?.split(',')?.contains(ideType) == true) { - implementation(project(":utbot-python")) - implementation(project(":utbot-intellij-python")) - } + if (projectType == standardProjectTypeName) { + if (pythonIde?.split(',')?.contains(ideType) == true) { + implementation(project(":utbot-python")) + implementation(project(":utbot-intellij-python")) + } - if (jsIde?.split(',')?.contains(ideType) == true) { - implementation(project(":utbot-js")) - implementation(project(":utbot-intellij-js")) - } + if (jsIde?.split(',')?.contains(ideType) == true) { + implementation(project(":utbot-js")) + implementation(project(":utbot-intellij-js")) + } - if (goIde?.split(',')?.contains(ideType) == true) { - implementation(project(":utbot-go")) - implementation(project(":utbot-intellij-go")) + if (goIde?.split(',')?.contains(ideType) == true) { + implementation(project(":utbot-go")) + implementation(project(":utbot-intellij-go")) + } } implementation(project(":utbot-android-studio")) From c6d23dd1636026497a274c0d82dac9e62b8536bf Mon Sep 17 00:00:00 2001 From: Egor Kulikov Date: Tue, 18 Jul 2023 11:09:03 +0300 Subject: [PATCH 03/10] Fix Kotlin plugin --- utbot-intellij/build.gradle.kts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utbot-intellij/build.gradle.kts b/utbot-intellij/build.gradle.kts index eb1c486d3f..008e9fe99a 100644 --- a/utbot-intellij/build.gradle.kts +++ b/utbot-intellij/build.gradle.kts @@ -41,6 +41,10 @@ intellij { "java" ) + val kotlinPlugins = mutableListOf( + "org.jetbrains.kotlin" + ) + androidStudioPath?.let { jvmPlugins += androidPlugins } val pythonCommunityPlugins = listOf( @@ -74,7 +78,7 @@ intellij { else -> jvmPlugins } } - springProjectTypeName -> jvmPlugins + springProjectTypeName -> jvmPlugins + kotlinPlugins + mavenUtilsPlugins else -> jvmPlugins } ) From dd6fff22d0696bea58f134a624f4daf1c5b836d6 Mon Sep 17 00:00:00 2001 From: IlyaMuravjov Date: Tue, 18 Jul 2023 15:25:21 +0300 Subject: [PATCH 04/10] Make standardProjectType include Spring-specific projects without their fat jars --- settings.gradle.kts | 5 +++-- utbot-framework/build.gradle | 10 ++++------ utbot-instrumentation/build.gradle.kts | 3 +-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/settings.gradle.kts b/settings.gradle.kts index 496c866381..668449e535 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -54,7 +54,10 @@ if (includeRiderInBuild.toBoolean()) { } include("utbot-ui-commons") + include("utbot-spring-commons-api") +include("utbot-spring-commons") +include("utbot-spring-analyzer") when (projectType) { standardProjectTypeName -> { @@ -79,8 +82,6 @@ when (projectType) { } springProjectTypeName -> { - include("utbot-spring-analyzer") - include("utbot-spring-commons") include("utbot-spring-sample") include("utbot-spring-test") } diff --git a/utbot-framework/build.gradle b/utbot-framework/build.gradle index 9f9ccea543..1a7baa916d 100644 --- a/utbot-framework/build.gradle +++ b/utbot-framework/build.gradle @@ -47,9 +47,9 @@ dependencies { fetchInstrumentationJar project(path: ':utbot-instrumentation', configuration: 'instrumentationArchive') + implementation project(':utbot-spring-commons-api') + implementation project(':utbot-spring-analyzer') if (projectType == springProjectTypeName) { - implementation project(':utbot-spring-commons-api') - implementation project(':utbot-spring-analyzer') fetchSpringAnalyzerJar project(path: ':utbot-spring-analyzer', configuration: 'springAnalyzerJar') } } @@ -59,9 +59,7 @@ processResources { into "lib" } - if (projectType == springProjectTypeName) { - from(configurations.fetchSpringAnalyzerJar) { - into "lib" - } + from(configurations.fetchSpringAnalyzerJar) { + into "lib" } } diff --git a/utbot-instrumentation/build.gradle.kts b/utbot-instrumentation/build.gradle.kts index 4feb0aa055..a6298a541f 100644 --- a/utbot-instrumentation/build.gradle.kts +++ b/utbot-instrumentation/build.gradle.kts @@ -46,8 +46,6 @@ val fetchSpringCommonsJar: Configuration by configurations.creating { dependencies { implementation(project(":utbot-framework-api")) implementation(project(":utbot-rd")) - implementation(project(":utbot-spring-commons-api")) - implementation("org.ow2.asm:asm:$asmVersion") implementation("org.ow2.asm:asm-commons:$asmVersion") @@ -61,6 +59,7 @@ dependencies { implementation("org.mockito:mockito-core:$mockitoVersion") implementation("org.mockito:mockito-inline:$mockitoInlineVersion") + implementation(project(":utbot-spring-commons-api")) if (projectType == springProjectTypeName) { fetchSpringCommonsJar(project(":utbot-spring-commons", configuration = "springCommonsJar")) } From 549bc547b297cba2ca7bbe946d1c0551f3ee5de7 Mon Sep 17 00:00:00 2001 From: IlyaMuravjov Date: Tue, 18 Jul 2023 15:27:15 +0300 Subject: [PATCH 05/10] Fallback to PureJvm for Spring projects, when utBotSpringRuntime is missing --- .../utbot/intellij/plugin/ui/GenerateTestsDialogWindow.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/GenerateTestsDialogWindow.kt b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/GenerateTestsDialogWindow.kt index 9e621d1fad..4234448588 100644 --- a/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/GenerateTestsDialogWindow.kt +++ b/utbot-intellij/src/main/kotlin/org/utbot/intellij/plugin/ui/GenerateTestsDialogWindow.kt @@ -367,8 +367,12 @@ class GenerateTestsDialogWindow(val model: GenerateTestsModel) : DialogWrapper(m DependencyInjectionFramework.installedItems.forEach { it.testFrameworkInstalled = findDependencyInjectionTestLibrary(model.testModule, it) != null } + + val isUtBotSpringRuntimePresent = this::class.java.classLoader.getResource("lib/utbot-spring-analyzer-shadow.jar") != null + model.projectType = - if (DependencyInjectionFramework.installedItems.isNotEmpty()) ProjectType.Spring + // TODO show some warning, when we see Spring project, but don't have `utBotSpringRuntime` + if (isUtBotSpringRuntimePresent && DependencyInjectionFramework.installedItems.isNotEmpty()) ProjectType.Spring else ProjectType.PureJvm // Configure notification urls callbacks From e31f82eab4611aaf9480fa9194cc32e34d40e2b8 Mon Sep 17 00:00:00 2001 From: IlyaMuravjov Date: Tue, 18 Jul 2023 15:27:55 +0300 Subject: [PATCH 06/10] Make `spring-tests` GitHub action use projectType=Spring --- .github/workflows/build-and-run-tests-from-branch.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-run-tests-from-branch.yml b/.github/workflows/build-and-run-tests-from-branch.yml index 7c2cdea3a0..52b91c9fef 100644 --- a/.github/workflows/build-and-run-tests-from-branch.yml +++ b/.github/workflows/build-and-run-tests-from-branch.yml @@ -203,7 +203,7 @@ jobs: - name: Run tests run: | cd utbot-spring-test - gradle --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx6g -Dkotlin.daemon.jvm.options=-Xmx4g :utbot-spring-test:test + gradle -PprojectType=Spring --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx6g -Dkotlin.daemon.jvm.options=-Xmx4g :utbot-spring-test:test - name: Upload logs if: ${{ always() }} From 52d82ab7047f45306c6de4335314ed64e7c4a139 Mon Sep 17 00:00:00 2001 From: Egor Kulikov Date: Tue, 18 Jul 2023 18:36:24 +0300 Subject: [PATCH 07/10] Support new artefact types --- .github/workflows/publish-plugin-from-branch.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/publish-plugin-from-branch.yml b/.github/workflows/publish-plugin-from-branch.yml index 2b432556ea..1eaff31cd0 100644 --- a/.github/workflows/publish-plugin-from-branch.yml +++ b/.github/workflows/publish-plugin-from-branch.yml @@ -48,6 +48,10 @@ jobs: extra_options: "-PideType=IC" - plugin_type: IU extra_options: "-PideType=IU" + - plugin_type: IC-Spring + extra_options: "-PideType=IC -PprojectType=Spring" + - plugin_type: IU-Spring + extra_options: "-PideType=IU -PprojectType=Spring" runs-on: ubuntu-20.04 container: unittestbot/java-env:java17-zulu-jdk-gradle7.6.1-kotlinc1.8.0 steps: From 177a02c7d8471cb2e6792dacb85c146536585c20 Mon Sep 17 00:00:00 2001 From: Egor Kulikov Date: Wed, 19 Jul 2023 16:01:49 +0300 Subject: [PATCH 08/10] Four modes introduces --- .../workflows/publish-plugin-from-branch.yml | 4 +- gradle.properties | 9 ++-- settings.gradle.kts | 49 ++++++++++--------- utbot-framework/build.gradle | 3 +- utbot-instrumentation/build.gradle.kts | 7 ++- utbot-intellij/build.gradle.kts | 30 ++++++------ utbot-rd/build.gradle | 2 +- 7 files changed, 57 insertions(+), 47 deletions(-) diff --git a/.github/workflows/publish-plugin-from-branch.yml b/.github/workflows/publish-plugin-from-branch.yml index 1eaff31cd0..26a19a4a55 100644 --- a/.github/workflows/publish-plugin-from-branch.yml +++ b/.github/workflows/publish-plugin-from-branch.yml @@ -45,9 +45,9 @@ jobs: matrix: configuration: - plugin_type: IC - extra_options: "-PideType=IC" + extra_options: "-PideType=IC -PprojectType=PureJava" - plugin_type: IU - extra_options: "-PideType=IU" + extra_options: "-PideType=IU -PprojectType=ExperimentalLanguages" - plugin_type: IC-Spring extra_options: "-PideType=IC -PprojectType=Spring" - plugin_type: IU-Spring diff --git a/gradle.properties b/gradle.properties index 537d34d80f..f33991f619 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,10 +3,13 @@ kotlin.code.style=official #Project Type # - Standard: for Java + { Python, JavaScript, Go } # - Spring: for Java + Spring -projectType=Standard +# - Ultimate: for all supported functionality +projectType=Ultimate -standardProjectTypeName=Standard -springProjectTypeName=Spring +pureJavaEdition=PureJava +languagesEdition=ExperimentalLanguages +springEdition=Spring +ultimateEdition=Ultimate # IU, IC, PC, PY # IC for AndroidStudio diff --git a/settings.gradle.kts b/settings.gradle.kts index 668449e535..d901f2e15e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,6 +1,8 @@ val projectType: String by settings -val standardProjectTypeName: String by settings -val springProjectTypeName: String by settings +val ultimateEdition: String by settings +val springEdition: String by settings +val languagesEdition: String by settings +val pureJavaEdition: String by settings val ideType: String by settings val buildType: String by settings @@ -59,32 +61,31 @@ include("utbot-spring-commons-api") include("utbot-spring-commons") include("utbot-spring-analyzer") -when (projectType) { - standardProjectTypeName -> { - if (pythonIde.split(",").contains(ideType)) { - include("utbot-python") - include("utbot-cli-python") - include("utbot-intellij-python") - include("utbot-python-parser") - } - - if (jsBuild == buildType || jsIde.split(",").contains(ideType)) { - include("utbot-js") - include("utbot-cli-js") - include("utbot-intellij-js") - } +if (projectType == languagesEdition || projectType == ultimateEdition) { + if (pythonIde.split(",").contains(ideType)) { + include("utbot-python") + include("utbot-cli-python") + include("utbot-intellij-python") + include("utbot-python-parser") + } - if (goIde.split(",").contains(ideType)) { - include("utbot-go") - include("utbot-cli-go") - include("utbot-intellij-go") - } + if (jsBuild == buildType || jsIde.split(",").contains(ideType)) { + include("utbot-js") + include("utbot-cli-js") + include("utbot-intellij-js") } - springProjectTypeName -> { - include("utbot-spring-sample") - include("utbot-spring-test") + if (goIde.split(",").contains(ideType)) { + include("utbot-go") + include("utbot-cli-go") + include("utbot-intellij-go") } } +if (projectType == springEdition || projectType == ultimateEdition) { + include("utbot-spring-sample") + include("utbot-spring-test") +} + + diff --git a/utbot-framework/build.gradle b/utbot-framework/build.gradle index 1a7baa916d..1d79027bb7 100644 --- a/utbot-framework/build.gradle +++ b/utbot-framework/build.gradle @@ -49,7 +49,8 @@ dependencies { implementation project(':utbot-spring-commons-api') implementation project(':utbot-spring-analyzer') - if (projectType == springProjectTypeName) { + + if (projectType == springEdition || projectType==ultimateEdition) { fetchSpringAnalyzerJar project(path: ':utbot-spring-analyzer', configuration: 'springAnalyzerJar') } } diff --git a/utbot-instrumentation/build.gradle.kts b/utbot-instrumentation/build.gradle.kts index a6298a541f..718aa6b29b 100644 --- a/utbot-instrumentation/build.gradle.kts +++ b/utbot-instrumentation/build.gradle.kts @@ -1,7 +1,10 @@ import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer val projectType: String by rootProject -val springProjectTypeName: String by rootProject +val ultimateEdition: String by rootProject +val springEdition: String by rootProject +val languagesEdition: String by rootProject +val pureJavaEdition: String by rootProject val asmVersion: String by rootProject val kryoVersion: String by rootProject @@ -60,7 +63,7 @@ dependencies { implementation("org.mockito:mockito-inline:$mockitoInlineVersion") implementation(project(":utbot-spring-commons-api")) - if (projectType == springProjectTypeName) { + if (projectType == springEdition || projectType == ultimateEdition) { fetchSpringCommonsJar(project(":utbot-spring-commons", configuration = "springCommonsJar")) } } diff --git a/utbot-intellij/build.gradle.kts b/utbot-intellij/build.gradle.kts index 008e9fe99a..264a23a689 100644 --- a/utbot-intellij/build.gradle.kts +++ b/utbot-intellij/build.gradle.kts @@ -1,6 +1,8 @@ val projectType: String by rootProject -val standardProjectTypeName: String by rootProject -val springProjectTypeName: String by rootProject +val ultimateEdition: String by rootProject +val springEdition: String by rootProject +val languagesEdition: String by rootProject +val pureJavaEdition: String by rootProject val intellijPluginVersion: String? by rootProject val kotlinLoggingVersion: String? by rootProject @@ -67,19 +69,19 @@ intellij { "org.jetbrains.idea.maven" ) + val basePluginSet = jvmPlugins + kotlinPlugins + mavenUtilsPlugins + androidPlugins + plugins.set( - when (projectType) { - standardProjectTypeName -> { - when (ideType) { - "IC" -> jvmPlugins + pythonCommunityPlugins + androidPlugins + mavenUtilsPlugins - "IU" -> jvmPlugins + pythonUltimatePlugins + jsPlugins + goPlugins + androidPlugins + mavenUtilsPlugins - "PC" -> pythonCommunityPlugins - "PY" -> pythonUltimatePlugins // something else, JS? - else -> jvmPlugins - } + if (projectType == languagesEdition || projectType == ultimateEdition) { + when (ideType) { + "IC" -> basePluginSet + pythonCommunityPlugins + "IU" -> basePluginSet + pythonUltimatePlugins + jsPlugins + goPlugins + "PC" -> pythonCommunityPlugins + "PY" -> pythonUltimatePlugins // something else, JS? + else -> basePluginSet } - springProjectTypeName -> jvmPlugins + kotlinPlugins + mavenUtilsPlugins - else -> jvmPlugins + } else { + basePluginSet } ) @@ -165,7 +167,7 @@ dependencies { implementation(project(":utbot-ui-commons")) //Family - if (projectType == standardProjectTypeName) { + if (projectType == languagesEdition || projectType == ultimateEdition) { if (pythonIde?.split(',')?.contains(ideType) == true) { implementation(project(":utbot-python")) implementation(project(":utbot-intellij-python")) diff --git a/utbot-rd/build.gradle b/utbot-rd/build.gradle index e511fce888..da4497637c 100644 --- a/utbot-rd/build.gradle +++ b/utbot-rd/build.gradle @@ -257,7 +257,7 @@ task generateCommonModels(type: RdGenTask) { } } -if (projectType == springProjectTypeName) { +if (projectType == springEdition || projectType == ultimateEdition) { task generateSpringModels(type: RdGenTask) { def currentProjectDir = project.projectDir def ideaPluginProjectDir = project.rootProject.childProjects["utbot-spring-analyzer"].projectDir From d5034cac6db559b3a59ffda8b02be89dcaaacefe Mon Sep 17 00:00:00 2001 From: Egor Kulikov Date: Wed, 19 Jul 2023 16:20:57 +0300 Subject: [PATCH 09/10] Correct documentation --- gradle.properties | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index f33991f619..603eb5e3b8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,8 @@ kotlin.code.style=official #Project Type -# - Standard: for Java + { Python, JavaScript, Go } +# - PureJava: no additional features +# - ExperimentalLanguages: for Java + { Python, JavaScript, Go } # - Spring: for Java + Spring # - Ultimate: for all supported functionality projectType=Ultimate From 3794c0159760772f6dfaaf4779f20731535a96e9 Mon Sep 17 00:00:00 2001 From: Egor Kulikov Date: Wed, 19 Jul 2023 16:49:02 +0300 Subject: [PATCH 10/10] Improve yaml scripts --- .github/workflows/build-and-run-tests-from-branch.yml | 2 +- .github/workflows/run-chosen-tests-from-branch.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-run-tests-from-branch.yml b/.github/workflows/build-and-run-tests-from-branch.yml index 52b91c9fef..67641da81f 100644 --- a/.github/workflows/build-and-run-tests-from-branch.yml +++ b/.github/workflows/build-and-run-tests-from-branch.yml @@ -135,7 +135,7 @@ jobs: - name: Run tests run: | - gradle --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx6g -Dkotlin.daemon.jvm.options=-Xmx4g :utbot-framework-test:test ${{ matrix.project.TESTS_TO_RUN }} + gradle -PprojectType=ExperimentalLanguages --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx6g -Dkotlin.daemon.jvm.options=-Xmx4g :utbot-framework-test:test ${{ matrix.project.TESTS_TO_RUN }} - name: Upload logs if: ${{ always() }} diff --git a/.github/workflows/run-chosen-tests-from-branch.yml b/.github/workflows/run-chosen-tests-from-branch.yml index 788f6187f4..e9029880fa 100644 --- a/.github/workflows/run-chosen-tests-from-branch.yml +++ b/.github/workflows/run-chosen-tests-from-branch.yml @@ -49,7 +49,7 @@ jobs: - name: Run chosen tests run: | - gradle :${{ github.event.inputs.project-name }}:test --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g --tests ${{ github.event.inputs.tests-bunch-name }} + gradle :${{ github.event.inputs.project-name }}:test -PprojectType=ExperimentalLanguages --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx2g -Dkotlin.daemon.jvm.options=-Xmx4g --tests ${{ github.event.inputs.tests-bunch-name }} - name: Upload ${{ github.event.inputs.project-name }} tests report if tests have failed if: ${{ failure() }}