Skip to content

Commit 8119ae3

Browse files
committed
First version for pycharm
1 parent 3c201eb commit 8119ae3

File tree

39 files changed

+1227
-240
lines changed

39 files changed

+1227
-240
lines changed

gradle.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ ultimateEdition=Ultimate
1010

1111
# IU, IC, PC, PY
1212
# IC for AndroidStudio
13-
ideType=IC
14-
ideVersion=232.8660.185
13+
ideType=PC
14+
#ideVersion=232.8660.185
15+
ideVersion=2023.2
1516
# ALL, NOJS
1617
buildType=NOJS
1718

settings.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ include("utbot-core")
2727
include("utbot-framework")
2828
include("utbot-framework-api")
2929
include("utbot-modificators-analyzer")
30-
include("utbot-intellij")
30+
if (ideType != "PC") {
31+
include("utbot-intellij")
32+
}
3133
include("utbot-sample")
3234
include("utbot-java-fuzzing")
3335
include("utbot-fuzzing")
@@ -87,4 +89,4 @@ if (projectType == ultimateEdition) {
8789
}
8890

8991
include("utbot-light")
90-
include("utbot-intellij-java")
92+
include("utbot-intellij-main")

utbot-intellij-main/build.gradle.kts

Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
val projectType: String by rootProject
2+
val communityEdition: String by rootProject
3+
val ultimateEdition: String by rootProject
4+
5+
val intellijPluginVersion: String? by rootProject
6+
val kotlinLoggingVersion: String? by rootProject
7+
val apacheCommonsTextVersion: String? by rootProject
8+
val jacksonVersion: String? by rootProject
9+
10+
val ideType: String? by rootProject
11+
val ideVersion: String? by rootProject
12+
val pythonCommunityPluginVersion: String? by rootProject
13+
val pythonUltimatePluginVersion: String? by rootProject
14+
val goPluginVersion: String? by rootProject
15+
16+
val pythonIde: String? by rootProject
17+
val jsIde: String? by rootProject
18+
val goIde: String? by rootProject
19+
20+
val sootVersion: String? by rootProject
21+
val kryoVersion: String? by rootProject
22+
val rdVersion: String? by rootProject
23+
val semVer: String? by rootProject
24+
val androidStudioPath: String? by rootProject
25+
26+
val junit5Version: String by rootProject
27+
val junit4PlatformVersion: String by rootProject
28+
29+
// https://plugins.jetbrains.com/docs/intellij/android-studio.html#configuring-the-plugin-pluginxml-file
30+
val ideTypeOrAndroidStudio = if (androidStudioPath == null) ideType else "IC"
31+
32+
//project.tasks.asMap["runIde"]?.enabled = false
33+
34+
plugins {
35+
id("org.jetbrains.intellij") version "1.13.1"
36+
}
37+
38+
intellij {
39+
40+
val androidPlugins = listOf("org.jetbrains.android")
41+
42+
val jvmPlugins = mutableListOf(
43+
"java"
44+
)
45+
46+
val kotlinPlugins = mutableListOf(
47+
"org.jetbrains.kotlin"
48+
)
49+
50+
androidStudioPath?.let { jvmPlugins += androidPlugins }
51+
52+
val pythonCommunityPlugins = listOf(
53+
"PythonCore:${pythonCommunityPluginVersion}"
54+
)
55+
56+
val pythonUltimatePlugins = listOf(
57+
"Pythonid:${pythonUltimatePluginVersion}"
58+
)
59+
60+
val jsPlugins = listOf(
61+
"JavaScript"
62+
)
63+
64+
val goPlugins = listOf(
65+
"org.jetbrains.plugins.go:${goPluginVersion}"
66+
)
67+
68+
val mavenUtilsPlugins = listOf(
69+
"org.jetbrains.idea.maven"
70+
)
71+
72+
val basePluginSet = jvmPlugins + kotlinPlugins + mavenUtilsPlugins + androidPlugins
73+
74+
plugins.set(
75+
when (projectType) {
76+
communityEdition -> basePluginSet + pythonCommunityPlugins
77+
ultimateEdition -> when (ideType) {
78+
"IC" -> basePluginSet + pythonCommunityPlugins
79+
"IU" -> basePluginSet + pythonUltimatePlugins + jsPlugins + goPlugins
80+
"PC" -> pythonCommunityPlugins
81+
"PY" -> pythonUltimatePlugins // something else, JS?
82+
else -> basePluginSet
83+
}
84+
else -> basePluginSet
85+
}
86+
)
87+
88+
version.set(ideVersion)
89+
type.set(ideTypeOrAndroidStudio)
90+
SettingsTemplateHelper.proceed(project)
91+
}
92+
93+
val remoteRobotVersion = "0.11.16"
94+
95+
tasks {
96+
compileKotlin {
97+
kotlinOptions {
98+
jvmTarget = "17"
99+
freeCompilerArgs = freeCompilerArgs + listOf("-Xallow-result-return-type", "-Xsam-conversions=class")
100+
allWarningsAsErrors = false
101+
}
102+
}
103+
104+
java {
105+
sourceCompatibility = JavaVersion.VERSION_17
106+
targetCompatibility = JavaVersion.VERSION_17
107+
}
108+
109+
runIde {
110+
jvmArgs("-Xmx2048m")
111+
jvmArgs("--add-exports", "java.desktop/sun.awt.windows=ALL-UNNAMED")
112+
androidStudioPath?.let { ideDir.set(file(it)) }
113+
}
114+
115+
patchPluginXml {
116+
sinceBuild.set("223")
117+
untilBuild.set("232.*")
118+
version.set(semVer)
119+
}
120+
121+
runIdeForUiTests {
122+
jvmArgs("-Xmx2048m", "-Didea.is.internal=true", "-Didea.ui.debug.mode=true")
123+
124+
systemProperty("robot-server.port", "8082") // default port 8580
125+
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
126+
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
127+
systemProperty("jb.consents.confirmation.enabled", "false")
128+
systemProperty("idea.trust.all.projects", "true")
129+
systemProperty("ide.mac.file.chooser.native", "false")
130+
systemProperty("jbScreenMenuBar.enabled", "false")
131+
systemProperty("apple.laf.useScreenMenuBar", "false")
132+
systemProperty("ide.show.tips.on.startup.default.value", "false")
133+
}
134+
135+
downloadRobotServerPlugin {
136+
version.set(remoteRobotVersion)
137+
}
138+
139+
test {
140+
description = "Runs UI integration tests."
141+
useJUnitPlatform {
142+
exclude("/org/utbot/**") //Comment this line to run the tests locally
143+
}
144+
}
145+
}
146+
147+
repositories {
148+
maven("https://jitpack.io")
149+
maven("https://packages.jetbrains.team/maven/p/ij/intellij-dependencies")
150+
}
151+
152+
dependencies {
153+
implementation(group ="com.jetbrains.rd", name = "rd-framework", version = rdVersion)
154+
implementation(group ="com.jetbrains.rd", name = "rd-core", version = rdVersion)
155+
implementation(group ="com.esotericsoftware.kryo", name = "kryo5", version = kryoVersion)
156+
implementation(group = "io.github.microutils", name = "kotlin-logging", version = kotlinLoggingVersion)
157+
implementation(group = "org.apache.commons", name = "commons-text", version = apacheCommonsTextVersion)
158+
implementation("org.apache.httpcomponents.client5:httpclient5:5.1")
159+
implementation(group = "com.fasterxml.jackson.module", name = "jackson-module-kotlin", version = jacksonVersion)
160+
161+
implementation(project(":utbot-framework")) { exclude(group = "org.slf4j", module = "slf4j-api") }
162+
implementation(project(":utbot-spring-framework")) { exclude(group = "org.slf4j", module = "slf4j-api") }
163+
implementation(project(":utbot-java-fuzzing"))
164+
//api(project(":utbot-analytics"))
165+
testImplementation("org.mock-server:mockserver-netty:5.4.1")
166+
testApi(project(":utbot-framework"))
167+
168+
implementation(project(":utbot-ui-commons"))
169+
170+
//Family
171+
172+
if (ideType != "PC") {
173+
implementation(project(":utbot-intellij"))
174+
}
175+
176+
if (pythonIde?.split(',')?.contains(ideType) == true) {
177+
api(project(":utbot-python"))
178+
api(project(":utbot-intellij-python"))
179+
}
180+
181+
if (projectType == ultimateEdition) {
182+
if (jsIde?.split(',')?.contains(ideType) == true) {
183+
implementation(project(":utbot-js"))
184+
implementation(project(":utbot-intellij-js"))
185+
}
186+
187+
if (goIde?.split(',')?.contains(ideType) == true) {
188+
implementation(project(":utbot-go"))
189+
implementation(project(":utbot-intellij-go"))
190+
}
191+
}
192+
193+
implementation(project(":utbot-android-studio"))
194+
195+
testImplementation("com.intellij.remoterobot:remote-robot:$remoteRobotVersion")
196+
testImplementation("com.intellij.remoterobot:remote-fixtures:$remoteRobotVersion")
197+
198+
testImplementation("org.assertj:assertj-core:3.11.1")
199+
200+
// Logging Network Calls
201+
testImplementation("com.squareup.okhttp3:logging-interceptor:4.10.0")
202+
203+
// Video Recording
204+
implementation("com.automation-remarks:video-recorder-junit5:2.0")
205+
206+
testImplementation("org.junit.jupiter:junit-jupiter-api:$junit5Version")
207+
testRuntimeOnly("org.junit.platform:junit-platform-launcher:$junit4PlatformVersion")
208+
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junit5Version")
209+
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:$junit5Version")
210+
}
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<!--suppress HttpUrlsUsage -->
2+
<idea-plugin>
3+
4+
<id>org.utbot.intellij.plugin.id</id>
5+
<name>UnitTestBot</name>
6+
<vendor>utbot.org</vendor>
7+
<depends>com.intellij.modules.platform</depends>
8+
9+
<depends optional="true" config-file="META-INF/withJava.xml">com.intellij.modules.java</depends>
10+
<depends optional="true" config-file="META-INF/withKotlin.xml">org.jetbrains.kotlin</depends>
11+
<depends optional="true" config-file="META-INF/withPython.xml">com.intellij.modules.python</depends>
12+
<depends optional="true" config-file="META-INF/withGo.xml">org.jetbrains.plugins.go</depends>
13+
<depends optional="true" config-file="META-INF/withAndroid.xml">org.jetbrains.android</depends>
14+
<depends optional="true" config-file="META-INF/withIdeaMaven.xml">org.jetbrains.idea.maven</depends>
15+
16+
<actions>
17+
<action id="org.utbot.intellij.plugin.ui.actions.GenerateTestsAction"
18+
class="org.utbot.intellij.plugin.ui.actions.GenerateTestsAction"
19+
text="Generate Tests with UnitTestBot..."
20+
description="Cover code with auto-generated tests">
21+
<add-to-group group-id="ProjectViewPopupMenu"/>
22+
<!-- <add-to-group group-id="GenerateGroup" anchor="after" relative-to-action="JavaGenerateGroup1"/>-->
23+
<keyboard-shortcut keymap="$default" first-keystroke="alt shift U"/>
24+
<keyboard-shortcut keymap="$default" first-keystroke="alt U" second-keystroke="alt T"/>
25+
</action>
26+
</actions>
27+
28+
<extensions defaultExtensionNs="com.intellij">
29+
<projectConfigurable dynamic="true" parentId="tools" instance="org.utbot.intellij.plugin.settings.Configurable"
30+
id="org.utbot.intellij.plugin.settings.Configurable"
31+
displayName="UnitTestBot"/>
32+
<!--suppress PluginXmlValidity -->
33+
<projectService serviceImplementation="org.utbot.intellij.plugin.settings.Settings" preload="true"/>
34+
<registryKey defaultValue="false" description="Enable editing Kotlin test files" key="kotlin.ultra.light.classes.empty.text.range"/>
35+
<!-- <postStartupActivity implementation="org.utbot.intellij.plugin.ui.GotItTooltipActivity"/>-->
36+
<projectModelModifier implementation="org.androidstudio.plugin.util.UtAndroidGradleJavaProjectModelModifierWrapper" order="first"/>
37+
<!-- <projectModelModifier implementation="org.utbot.intellij.plugin.util.UtMavenProjectModelModifier" order="first"/>-->
38+
<!-- <projectModelModifier implementation="org.utbot.intellij.plugin.util.UtIdeaProjectModelModifier" order="first"/>-->
39+
<!--Documentation-->
40+
<!-- <customJavadocTagProvider implementation="org.utbot.intellij.plugin.javadoc.UtCustomJavaDocTagProvider"/>-->
41+
<!-- <lang.documentationProvider language="JAVA" order="first" implementationClass="org.utbot.intellij.plugin.javadoc.UtDocumentationProvider"/>-->
42+
</extensions>
43+
44+
<!-- Minimum and maximum build of IDE compatible with the plugin -->
45+
<description>
46+
<![CDATA[
47+
UnitTestBot is the tool for automated unit test generation and precise code analysis.
48+
<br/><br/>
49+
Discover UnitTestBot key features in our latest release:
50+
<ul>
51+
<li>generating ready-to-use test cases — with valid inputs, method bodies, assertions, and comments</li>
52+
<li>maximizing <a href="https://en.wikipedia.org/wiki/Code_coverage">branch coverage</a> in <i>regression suite</i> while keeping the number of tests minimized</li>
53+
<li>finding deeply hidden code defects and expressing them as tests</li>
54+
<li>fine-tuned <a href="https://github.com/UnitTestBot/UTBotJava/wiki/Fine-tune-test-generation#mocking-settings">mocking</a>, including mocking static methods</li>
55+
<li>representing all the <a href="https://github.com/UnitTestBot/UTBotJava/wiki/Get-use-of-test-results#read-test-descriptions">test descriptions</a> in a human-readable format</li>
56+
<li>generating <a href="https://github.com/microsoft/sarif-tutorials/blob/main/README.md">SARIF</a> reports</li>
57+
<li>innovative symbolic execution engine combined with a smart fuzzing platform</li>
58+
</ul>
59+
UnitTestBot supports the latest JDKs, JUnit 4, JUnit 5, TestNG, Mockito and is suitable for all popular operational systems.
60+
<br/>
61+
Try <a href="https://www.utbot.org/demo/?language=Java&source=public%20class%20Recursion%20%7B%0A%0A%20%20public%20int%20fib(int%20n)%20%7B%0A%20%20%20%20if%20(n%20%3C%200)%20throw%20new%20IllegalArgumentException()%3B%0A%20%20%20%20if%20(n%20%3D%3D%200)%20return%200%3B%0A%20%20%20%20if%20(n%20%3D%3D%201)%20return%201%3B%0A%20%20%20%20%0A%20%20%20%20return%20fib(n%20-%201)%20%2B%20fib(n%20-%202)%3B%0A%20%20%7D%0A%7D%0A">UnitTestBot online demo</a> to see how it generates tests for your code in real time.
62+
<br/>
63+
Contribute to UnitTestBot via <a href="https://github.com/UnitTestBot/UTBotJava/blob/main/CONTRIBUTING.md">GitHub</a>.
64+
<br/>
65+
Found a bug? File an <a href="https://github.com/UnitTestBot/UTBotJava/issues">issue</a>.
66+
<br/>
67+
Have an idea? Start a <a href="https://github.com/UnitTestBot/UTBotJava/discussions">discussion</a>.
68+
]]>
69+
</description>
70+
<change-notes>
71+
<![CDATA[
72+
Check out UnitTestBot new features and major improvements in the latest release:
73+
<ul>
74+
<li>Generating tests for Python and JavaScript</li>
75+
<li>New fuzzing platform providing support for multiple languages</li>
76+
<li>Improved test generation for Kotlin code</li>
77+
<li>Multiprocess architecture based on the <a href="https://github.com/JetBrains/rd">Reactive Distributed communication framework</a> with advanced logging and debugging options</li>
78+
<li>Symbolic execution engine with higher priority and fewer false UNSAT verdicts</li>
79+
<li>UI/UX improvements for test sources root, <code>setting.properties</code> file, cancellation, timeout settings, notifications</li>
80+
<li>Summaries with fine-grained settings</li>
81+
<li>SARIF reports enabled by default, displaying sandbox-related and timeout test failures, properly addressing source files</li>
82+
<li>Improved monitoring visualized with Grafana</li>
83+
<li>Test generation bug fixes</li>
84+
<li>Detailed documentation on UnitTestBot components including UnitTestBot architecture overview</li>
85+
</ul>
86+
]]>
87+
</change-notes>
88+
<!-- <extensions defaultExtensionNs="com.intellij">-->
89+
<!-- <globalInspection language="JAVA"-->
90+
<!-- displayName="Errors detected by UnitTestBot"-->
91+
<!-- groupPath="Java"-->
92+
<!-- groupBundle="messages.InspectionsBundle"-->
93+
<!-- groupKey="group.names.probable.bugs"-->
94+
<!-- enabledByDefault="true"-->
95+
<!-- level="ERROR"-->
96+
<!-- implementationClass="org.utbot.intellij.plugin.inspection.UnitTestBotInspectionTool"/>-->
97+
<!-- </extensions>-->
98+
99+
</idea-plugin>
Lines changed: 4 additions & 0 deletions
Loading
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<!--Optional dependency on org.jetbrains.android-->
2+
<extensions defaultExtensionNs="org.jetbrains.android">
3+
</extensions>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<!--Optional dependency on org.jetbrains.plugins.go-->
2+
<extensions defaultExtensionNs="org.jetbrains.plugins.go">
3+
</extensions>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<!--Optional dependency on org.jetbrains.idea.maven-->
2+
<extensions defaultExtensionNs="org.jetbrains.idea.maven">
3+
</extensions>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<!--Optional dependency on org.jetbrains.android-->
2+
<extensions defaultExtensionNs="com.intellij">
3+
<depends>JavaScript</depends>
4+
</extensions>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<!--Optional dependency on org.jetbrains.android-->
2+
<extensions defaultExtensionNs="com.intellij.modules.java">
3+
</extensions>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<!--Optional dependency on org.jetbrains.android-->
2+
<extensions defaultExtensionNs="org.jetbrains.kotlin">
3+
</extensions>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<!--Optional dependency on org.jetbrains.android-->
2+
<extensions defaultExtensionNs="com.intellij.modules.lang">
3+
</extensions>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<!--Optional dependency on com.intellij.modules.python-->
2+
<extensions defaultExtensionNs="com.intellij">
3+
<depends>com.intellij.modules.python</depends>
4+
</extensions>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# suppress inspection "HttpUrlsUsage" for whole file
2+
backing.service.possibleEndpoints=http://utbot.org
3+
backing.service.urlPath=/utbot/errors
4+
backing.service.port=11000
5+
request.timeoutMillis=5000

0 commit comments

Comments
 (0)