Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0312936

Browse files
EgorkaKulikovalisevych
andauthored
Create two UnitTestBot plugin versions for IC and IU (#2491)
* Gradle programming phase * Yaml programming phase * Project Type comment correction for Ultimate IntelliJ plugin version --------- Co-authored-by: Alena Lisevych <alena.lisevych@gmail.com>
1 parent 19ab8f5 commit 0312936

File tree

9 files changed

+51
-80
lines changed

9 files changed

+51
-80
lines changed

‎.github/workflows/build-and-run-tests-from-branch.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ jobs:
135135

136136
- name: Run tests
137137
run: |
138-
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 }}
138+
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 }}
139139
140140
- name: Upload logs
141141
if: ${{ always() }}
@@ -203,7 +203,7 @@ jobs:
203203
- name: Run tests
204204
run: |
205205
cd utbot-spring-test
206-
gradle -PprojectType=Spring --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx6g -Dkotlin.daemon.jvm.options=-Xmx4g :utbot-spring-test:test
206+
gradle -PprojectType=Community --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx6g -Dkotlin.daemon.jvm.options=-Xmx4g :utbot-spring-test:test
207207
208208
- name: Upload logs
209209
if: ${{ always() }}

‎.github/workflows/publish-plugin-from-branch.yml‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,9 @@ jobs:
4545
matrix:
4646
configuration:
4747
- plugin_type: IC
48-
extra_options: "-PideType=IC -PprojectType=PureJava"
48+
extra_options: "-PideType=IC -PprojectType=Community"
4949
- plugin_type: IU
50-
extra_options: "-PideType=IU -PprojectType=ExperimentalLanguages"
51-
- plugin_type: IC-Spring
52-
extra_options: "-PideType=IC -PprojectType=Spring"
53-
- plugin_type: IU-Spring
54-
extra_options: "-PideType=IU -PprojectType=Spring"
50+
extra_options: "-PideType=IU -PprojectType=Ultimate"
5551
runs-on: ubuntu-20.04
5652
container: unittestbot/java-env:java17-zulu-jdk-gradle7.6.1-kotlinc1.8.0
5753
steps:

‎.github/workflows/run-chosen-tests-from-branch.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
5050
- name: Run chosen tests
5151
run: |
52-
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 }}
52+
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 }}
5353
5454
- name: Upload ${{ github.event.inputs.project-name }} tests report if tests have failed
5555
if: ${{ failure() }}

‎gradle.properties‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
11
kotlin.code.style=official
22

33
#Project Type
4-
# - PureJava: no additional features
5-
# - ExperimentalLanguages: for Java + { Python, JavaScript, Go }
6-
# - Spring: for Java + Spring
7-
# - Ultimate: for all supported functionality
4+
# - Community: for Java + Spring + Python (IC supported features)
5+
# - Ultimate: for Java + Spring + Python (IU supported features) + JavaScript + Go
86
projectType=Ultimate
97

10-
pureJavaEdition=PureJava
11-
languagesEdition=ExperimentalLanguages
12-
springEdition=Spring
8+
communityEdition = Community
139
ultimateEdition=Ultimate
1410

1511
# IU, IC, PC, PY

‎settings.gradle.kts‎

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
val projectType: String by settings
2+
val communityEdition: String by settings
23
val ultimateEdition: String by settings
3-
val springEdition: String by settings
4-
val languagesEdition: String by settings
5-
val pureJavaEdition: String by settings
64

75
val ideType: String by settings
86
val buildType: String by settings
@@ -62,14 +60,17 @@ include("utbot-spring-commons-api")
6260
include("utbot-spring-commons")
6361
include("utbot-spring-analyzer")
6462

65-
if (projectType == languagesEdition || projectType == ultimateEdition) {
66-
if (pythonIde.split(",").contains(ideType)) {
67-
include("utbot-python")
68-
include("utbot-cli-python")
69-
include("utbot-intellij-python")
70-
include("utbot-python-parser")
71-
}
63+
if (pythonIde.split(",").contains(ideType)) {
64+
include("utbot-python")
65+
include("utbot-cli-python")
66+
include("utbot-intellij-python")
67+
include("utbot-python-parser")
68+
}
7269

70+
include("utbot-spring-sample")
71+
include("utbot-spring-test")
72+
73+
if (projectType == ultimateEdition) {
7374
if (jsBuild == buildType || jsIde.split(",").contains(ideType)) {
7475
include("utbot-js")
7576
include("utbot-cli-js")
@@ -83,12 +84,5 @@ if (projectType == languagesEdition || projectType == ultimateEdition) {
8384
}
8485
}
8586

86-
if (projectType == springEdition || projectType == ultimateEdition) {
87-
include("utbot-spring-sample")
88-
include("utbot-spring-test")
89-
}
90-
91-
92-
9387
include("utbot-light")
9488

‎utbot-framework/build.gradle‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,7 @@ dependencies {
5050

5151
implementation project(':utbot-spring-commons-api')
5252
implementation project(':utbot-spring-analyzer')
53-
54-
if (projectType == springEdition || projectType==ultimateEdition) {
55-
fetchSpringAnalyzerJar project(path: ':utbot-spring-analyzer', configuration: 'springAnalyzerJar')
56-
}
53+
fetchSpringAnalyzerJar project(path: ':utbot-spring-analyzer', configuration: 'springAnalyzerJar')
5754
}
5855

5956
processResources {

‎utbot-instrumentation/build.gradle.kts‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer
22

3-
val projectType: String by rootProject
4-
val ultimateEdition: String by rootProject
5-
val springEdition: String by rootProject
6-
val languagesEdition: String by rootProject
7-
val pureJavaEdition: String by rootProject
8-
93
val asmVersion: String by rootProject
104
val kryoVersion: String by rootProject
115
val kryoSerializersVersion: String by rootProject
@@ -63,9 +57,7 @@ dependencies {
6357
implementation("org.mockito:mockito-inline:$mockitoInlineVersion")
6458

6559
implementation(project(":utbot-spring-commons-api"))
66-
if (projectType == springEdition || projectType == ultimateEdition) {
67-
fetchSpringCommonsJar(project(":utbot-spring-commons", configuration = "springCommonsJar"))
68-
}
60+
fetchSpringCommonsJar(project(":utbot-spring-commons", configuration = "springCommonsJar"))
6961
}
7062

7163
/**

‎utbot-intellij/build.gradle.kts‎

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
val projectType: String by rootProject
2+
val communityEdition: String by rootProject
23
val ultimateEdition: String by rootProject
3-
val springEdition: String by rootProject
4-
val languagesEdition: String by rootProject
5-
val pureJavaEdition: String by rootProject
64

75
val intellijPluginVersion: String? by rootProject
86
val kotlinLoggingVersion: String? by rootProject
@@ -72,16 +70,16 @@ intellij {
7270
val basePluginSet = jvmPlugins + kotlinPlugins + mavenUtilsPlugins + androidPlugins
7371

7472
plugins.set(
75-
if (projectType == languagesEdition || projectType == ultimateEdition) {
76-
when (ideType) {
73+
when (projectType) {
74+
communityEdition -> basePluginSet + pythonCommunityPlugins
75+
ultimateEdition -> when (ideType) {
7776
"IC" -> basePluginSet + pythonCommunityPlugins
7877
"IU" -> basePluginSet + pythonUltimatePlugins + jsPlugins + goPlugins
7978
"PC" -> pythonCommunityPlugins
8079
"PY" -> pythonUltimatePlugins // something else, JS?
8180
else -> basePluginSet
8281
}
83-
} else {
84-
basePluginSet
82+
else -> basePluginSet
8583
}
8684
)
8785

@@ -167,12 +165,13 @@ dependencies {
167165
implementation(project(":utbot-ui-commons"))
168166

169167
//Family
170-
if (projectType == languagesEdition || projectType == ultimateEdition) {
171-
if (pythonIde?.split(',')?.contains(ideType) == true) {
172-
implementation(project(":utbot-python"))
173-
implementation(project(":utbot-intellij-python"))
174-
}
175168

169+
if (pythonIde?.split(',')?.contains(ideType) == true) {
170+
implementation(project(":utbot-python"))
171+
implementation(project(":utbot-intellij-python"))
172+
}
173+
174+
if (projectType == ultimateEdition) {
176175
if (jsIde?.split(',')?.contains(ideType) == true) {
177176
implementation(project(":utbot-js"))
178177
implementation(project(":utbot-intellij-js"))

‎utbot-rd/build.gradle‎

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -257,34 +257,31 @@ task generateCommonModels(type: RdGenTask) {
257257
}
258258
}
259259

260-
if (projectType == springEdition || projectType == ultimateEdition) {
261-
task generateSpringModels(type: RdGenTask) {
262-
def currentProjectDir = project.projectDir
263-
def ideaPluginProjectDir = project.rootProject.childProjects["utbot-spring-analyzer"].projectDir
264-
def generatedOutputDir = new File(ideaPluginProjectDir, "src/main/kotlin/org/utbot/spring/generated")
265-
def hashDir = generatedOutputDir
266-
def sourcesDir = new File(currentProjectDir, "src/main/rdgen/org/utbot/rd/models")
267-
def rdParams = extensions.getByName("params") as RdGenExtension
260+
task generateSpringModels(type: RdGenTask) {
261+
def currentProjectDir = project.projectDir
262+
def ideaPluginProjectDir = project.rootProject.childProjects["utbot-spring-analyzer"].projectDir
263+
def generatedOutputDir = new File(ideaPluginProjectDir, "src/main/kotlin/org/utbot/spring/generated")
264+
def hashDir = generatedOutputDir
265+
def sourcesDir = new File(currentProjectDir, "src/main/rdgen/org/utbot/rd/models")
266+
def rdParams = extensions.getByName("params") as RdGenExtension
268267

269-
group = "rdgen"
270-
rdParams.verbose = true
271-
rdParams.sources(sourcesDir)
272-
rdParams.hashFolder = hashDir.canonicalPath
273-
// where to search roots
274-
rdParams.packages = "org.utbot.rd.models"
268+
group = "rdgen"
269+
rdParams.verbose = true
270+
rdParams.sources(sourcesDir)
271+
rdParams.hashFolder = hashDir.canonicalPath
272+
// where to search roots
273+
rdParams.packages = "org.utbot.rd.models"
275274

276-
rdParams.generator {
277-
language = "kotlin"
278-
transform = "symmetric"
279-
root = "org.utbot.rd.models.SpringAnalyzerRoot"
275+
rdParams.generator {
276+
language = "kotlin"
277+
transform = "symmetric"
278+
root = "org.utbot.rd.models.SpringAnalyzerRoot"
280279

281-
directory = generatedOutputDir.canonicalPath
282-
namespace = "org.utbot.spring.generated"
283-
}
280+
directory = generatedOutputDir.canonicalPath
281+
namespace = "org.utbot.spring.generated"
284282
}
285283
}
286284

287-
288285
task generateCSharpModels(type: RdGenTask) {
289286
def currentProjectDir = project.projectDir
290287
def riderPluginProjectDir = project.rootProject.projectDir.toPath().resolve("utbot-rider").toFile()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /