diff --git a/.github/workflows/build-and-run-tests-from-branch.yml b/.github/workflows/build-and-run-tests-from-branch.yml index 67641da81f..db2a58118a 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 -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 }} + gradle -PprojectType=Ultimate --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() }} @@ -203,7 +203,7 @@ jobs: - name: Run tests run: | cd utbot-spring-test - gradle -PprojectType=Spring --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx6g -Dkotlin.daemon.jvm.options=-Xmx4g :utbot-spring-test:test + gradle -PprojectType=Community --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx6g -Dkotlin.daemon.jvm.options=-Xmx4g :utbot-spring-test:test - name: Upload logs if: ${{ always() }} diff --git a/.github/workflows/publish-plugin-from-branch.yml b/.github/workflows/publish-plugin-from-branch.yml index 26a19a4a55..2e4f5ec84b 100644 --- a/.github/workflows/publish-plugin-from-branch.yml +++ b/.github/workflows/publish-plugin-from-branch.yml @@ -45,13 +45,9 @@ jobs: matrix: configuration: - plugin_type: IC - extra_options: "-PideType=IC -PprojectType=PureJava" + extra_options: "-PideType=IC -PprojectType=Community" - plugin_type: IU - extra_options: "-PideType=IU -PprojectType=ExperimentalLanguages" - - plugin_type: IC-Spring - extra_options: "-PideType=IC -PprojectType=Spring" - - plugin_type: IU-Spring - extra_options: "-PideType=IU -PprojectType=Spring" + extra_options: "-PideType=IU -PprojectType=Ultimate" runs-on: ubuntu-20.04 container: unittestbot/java-env:java17-zulu-jdk-gradle7.6.1-kotlinc1.8.0 steps: diff --git a/.github/workflows/run-chosen-tests-from-branch.yml b/.github/workflows/run-chosen-tests-from-branch.yml index e9029880fa..ea5dec9ac5 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 -PprojectType=ExperimentalLanguages --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=Ultimate --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() }} diff --git a/gradle.properties b/gradle.properties index 2965a18d26..d515c05281 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,15 +1,11 @@ kotlin.code.style=official #Project Type -# - PureJava: no additional features -# - ExperimentalLanguages: for Java + { Python, JavaScript, Go } -# - Spring: for Java + Spring -# - Ultimate: for all supported functionality +# - Community: for Java + Spring + Python (IC supported features) +# - Ultimate: for Java + Spring + Python (IU supported features) + JavaScript + Go projectType=Ultimate -pureJavaEdition=PureJava -languagesEdition=ExperimentalLanguages -springEdition=Spring +communityEdition = Community ultimateEdition=Ultimate # IU, IC, PC, PY diff --git a/settings.gradle.kts b/settings.gradle.kts index 7e15d4d126..f4b9733902 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,8 +1,6 @@ val projectType: String by settings +val communityEdition: 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 @@ -61,14 +59,17 @@ include("utbot-spring-commons-api") include("utbot-spring-commons") include("utbot-spring-analyzer") -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 (pythonIde.split(",").contains(ideType)) { + include("utbot-python") + include("utbot-cli-python") + include("utbot-intellij-python") + include("utbot-python-parser") +} +include("utbot-spring-sample") +include("utbot-spring-test") + +if (projectType == ultimateEdition) { if (jsBuild == buildType || jsIde.split(",").contains(ideType)) { include("utbot-js") include("utbot-cli-js") @@ -82,12 +83,5 @@ if (projectType == languagesEdition || projectType == ultimateEdition) { } } -if (projectType == springEdition || projectType == ultimateEdition) { - include("utbot-spring-sample") - include("utbot-spring-test") -} - - - include("utbot-light") diff --git a/utbot-framework/build.gradle b/utbot-framework/build.gradle index 1d79027bb7..7f6f105c2d 100644 --- a/utbot-framework/build.gradle +++ b/utbot-framework/build.gradle @@ -49,10 +49,7 @@ dependencies { implementation project(':utbot-spring-commons-api') implementation project(':utbot-spring-analyzer') - - if (projectType == springEdition || projectType==ultimateEdition) { - fetchSpringAnalyzerJar project(path: ':utbot-spring-analyzer', configuration: 'springAnalyzerJar') - } + fetchSpringAnalyzerJar project(path: ':utbot-spring-analyzer', configuration: 'springAnalyzerJar') } processResources { diff --git a/utbot-instrumentation/build.gradle.kts b/utbot-instrumentation/build.gradle.kts index 718aa6b29b..ca8ea1f469 100644 --- a/utbot-instrumentation/build.gradle.kts +++ b/utbot-instrumentation/build.gradle.kts @@ -1,11 +1,5 @@ import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer -val projectType: 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 val kryoSerializersVersion: String by rootProject @@ -63,9 +57,7 @@ dependencies { implementation("org.mockito:mockito-inline:$mockitoInlineVersion") implementation(project(":utbot-spring-commons-api")) - if (projectType == springEdition || projectType == ultimateEdition) { - fetchSpringCommonsJar(project(":utbot-spring-commons", configuration = "springCommonsJar")) - } + fetchSpringCommonsJar(project(":utbot-spring-commons", configuration = "springCommonsJar")) } /** diff --git a/utbot-intellij/build.gradle.kts b/utbot-intellij/build.gradle.kts index 01f4a81802..bd0a5f8f9b 100644 --- a/utbot-intellij/build.gradle.kts +++ b/utbot-intellij/build.gradle.kts @@ -1,8 +1,6 @@ val projectType: String by rootProject +val communityEdition: 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 @@ -72,16 +70,16 @@ intellij { val basePluginSet = jvmPlugins + kotlinPlugins + mavenUtilsPlugins + androidPlugins plugins.set( - if (projectType == languagesEdition || projectType == ultimateEdition) { - when (ideType) { + when (projectType) { + communityEdition -> basePluginSet + pythonCommunityPlugins + ultimateEdition -> when (ideType) { "IC" -> basePluginSet + pythonCommunityPlugins "IU" -> basePluginSet + pythonUltimatePlugins + jsPlugins + goPlugins "PC" -> pythonCommunityPlugins "PY" -> pythonUltimatePlugins // something else, JS? else -> basePluginSet } - } else { - basePluginSet + else -> basePluginSet } ) @@ -167,12 +165,13 @@ dependencies { implementation(project(":utbot-ui-commons")) //Family - if (projectType == languagesEdition || projectType == ultimateEdition) { - if (pythonIde?.split(',')?.contains(ideType) == true) { - implementation(project(":utbot-python")) - implementation(project(":utbot-intellij-python")) - } + if (pythonIde?.split(',')?.contains(ideType) == true) { + implementation(project(":utbot-python")) + implementation(project(":utbot-intellij-python")) + } + + if (projectType == ultimateEdition) { if (jsIde?.split(',')?.contains(ideType) == true) { implementation(project(":utbot-js")) implementation(project(":utbot-intellij-js")) diff --git a/utbot-rd/build.gradle b/utbot-rd/build.gradle index da4497637c..7f375a837e 100644 --- a/utbot-rd/build.gradle +++ b/utbot-rd/build.gradle @@ -257,34 +257,31 @@ task generateCommonModels(type: RdGenTask) { } } -if (projectType == springEdition || projectType == ultimateEdition) { - 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 +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()