Skip to content

Commit 2f70a45

Browse files
committed
[utbot-rider]
1. introducing first version of UtBot for Rider, based on VSharp symbolic engine 2. Added `Run Rider` run configuration
1 parent d7800c4 commit 2f70a45

39 files changed

+2018
-10
lines changed

.run/Run IDE.run.xml renamed to .run/Run IDEA.run.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<component name="ProjectRunConfigurationManager">
2-
<configuration default="false" name="Run IDE" type="GradleRunConfiguration" factoryName="Gradle">
2+
<configuration default="false" name="Run IDEA" type="GradleRunConfiguration" factoryName="Gradle">
33
<ExternalSystemSettings>
44
<option name="executionName" />
55
<option name="externalProjectPath" value="$PROJECT_DIR$/utbot-intellij" />

.run/Run Rider.run.xml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<component name="ProjectRunConfigurationManager">
2+
<configuration default="false" name="Run Rider" type="GradleRunConfiguration" factoryName="Gradle">
3+
<ExternalSystemSettings>
4+
<option name="executionName" />
5+
<option name="externalProjectPath" value="$PROJECT_DIR$/utbot-rider" />
6+
<option name="externalSystemIdString" value="GRADLE" />
7+
<option name="scriptParameters" value="-PincludeRiderInBuild=true" />
8+
<option name="taskDescriptions">
9+
<list />
10+
</option>
11+
<option name="taskNames">
12+
<list>
13+
<option value="runIde" />
14+
</list>
15+
</option>
16+
<option name="vmOptions" />
17+
</ExternalSystemSettings>
18+
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
19+
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
20+
<DebugAllEnabled>false</DebugAllEnabled>
21+
<method v="2" />
22+
</configuration>
23+
</component>

gradle.properties

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,14 @@ collectionsVersion=0.3.4
3232
# as they cannot be set from properties
3333
# utbot-intellij/build.gradle.kts
3434
# utbot-rd/build.gradle
35-
rdVersion=2022.3.4
35+
# utbot-rider/build.gradle.kts
3636
intellijPluginVersion=1.7.0
37+
# every time you bump rd version:
38+
# 1. regenerate all models
39+
# 2. check if rider plugin works
40+
rdVersion=2022.2.1
41+
# to enable - add -PincludeRiderInBuild=true in build CLI
42+
includeRiderInBuild=false
3743
jacocoVersion=0.8.8
3844
commonsLangVersion=3.11
3945
commonsIoVersion=2.8.0
@@ -68,9 +74,17 @@ shadowJarVersion=7.1.2
6874
openblasVersion=0.3.10-1.5.4
6975
arpackNgVersion=3.7.0-1.5.4
7076

77+
# configuration for build server
7178
org.gradle.daemon=false
7279
org.gradle.parallel=false
7380
org.gradle.jvmargs="-XX:MaxHeapSize=6144m"
7481
kotlin.compiler.execution.strategy=in-process
82+
org.gradle.caching=false
7583

76-
org.gradle.caching=false
84+
# configuration for local compilation - much faster
85+
#org.gradle.daemon=true
86+
#kotlin.daemon.jvm.options=-Xmx4g
87+
#org.gradle.parallel=true
88+
#org.gradle.caching=true
89+
#org.gradle.workers.max=8
90+
#org.gradle.jvmargs="-XX:MaxHeapSize=6144m"

settings.gradle.kts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ val ideType: String by settings
22

33
val pythonIde: String by settings
44
val jsIde: String by settings
5+
val includeRiderInBuild: String by settings
56

67
pluginManagement {
78
resolutionStrategy {
@@ -40,6 +41,10 @@ include("utbot-testing")
4041
include("utbot-rd")
4142
include("utbot-android-studio")
4243

44+
if (includeRiderInBuild.toBoolean()) {
45+
include("utbot-rider")
46+
}
47+
4348
include("utbot-ui-commons")
4449

4550
if (pythonIde.split(",").contains(ideType)) {

utbot-framework/src/main/kotlin/org/utbot/framework/process/generated/EngineProcessModel.Generated.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ class EngineProcessModel private constructor(
6666
fun create(lifetime: Lifetime, protocol: IProtocol): EngineProcessModel {
6767
EngineProcessRoot.register(protocol.serializers)
6868

69-
return EngineProcessModel()
69+
return EngineProcessModel().apply {
70+
identify(protocol.identity, RdId.Null.mix("EngineProcessModel"))
71+
bind(lifetime, protocol, "EngineProcessModel")
72+
}
7073
}
7174

7275

utbot-framework/src/main/kotlin/org/utbot/framework/process/generated/RdInstrumenterAdapter.Generated.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ class RdInstrumenterAdapter private constructor(
4242
fun create(lifetime: Lifetime, protocol: IProtocol): RdInstrumenterAdapter {
4343
EngineProcessRoot.register(protocol.serializers)
4444

45-
return RdInstrumenterAdapter()
45+
return RdInstrumenterAdapter().apply {
46+
identify(protocol.identity, RdId.Null.mix("RdInstrumenterAdapter"))
47+
bind(lifetime, protocol, "RdInstrumenterAdapter")
48+
}
4649
}
4750

4851
private val __StringNullableSerializer = FrameworkMarshallers.String.nullable()

utbot-framework/src/main/kotlin/org/utbot/framework/process/generated/RdSourceFindingStrategy.Generated.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ class RdSourceFindingStrategy private constructor(
4444
fun create(lifetime: Lifetime, protocol: IProtocol): RdSourceFindingStrategy {
4545
EngineProcessRoot.register(protocol.serializers)
4646

47-
return RdSourceFindingStrategy()
47+
return RdSourceFindingStrategy().apply {
48+
identify(protocol.identity, RdId.Null.mix("RdSourceFindingStrategy"))
49+
bind(lifetime, protocol, "RdSourceFindingStrategy")
50+
}
4851
}
4952

5053
private val __StringNullableSerializer = FrameworkMarshallers.String.nullable()

utbot-instrumentation/src/main/kotlin/org/utbot/instrumentation/rd/generated/InstrumentedProcessModel.Generated.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ class InstrumentedProcessModel private constructor(
5555
fun create(lifetime: Lifetime, protocol: IProtocol): InstrumentedProcessModel {
5656
InstrumentedProcessRoot.register(protocol.serializers)
5757

58-
return InstrumentedProcessModel()
58+
return InstrumentedProcessModel().apply {
59+
identify(protocol.identity, RdId.Null.mix("InstrumentedProcessModel"))
60+
bind(lifetime, protocol, "InstrumentedProcessModel")
61+
}
5962
}
6063

6164

utbot-rd/build.gradle

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'com.jetbrains.rdgen' version "2022.3.4"
2+
id 'com.jetbrains.rdgen' version "2022.2.1"
33
}
44

55
import com.jetbrains.rd.generator.gradle.RdGenExtension
@@ -181,4 +181,28 @@ task generateCommonModels(type: RdGenTask) {
181181
directory = generatedOutputDir.canonicalPath
182182
namespace = "org.utbot.rd.generated"
183183
}
184+
}
185+
186+
task generateCSharpModels(type: RdGenTask) {
187+
def currentProjectDir = project.projectDir
188+
def riderPluginProjectDir = project.rootProject.projectDir.toPath().resolve("utbot-rider").toFile()
189+
def generatedOutputDir = new File (riderPluginProjectDir, "src/dotnet/UtBot/UtBot.Rd/Generated")
190+
def hashDir = generatedOutputDir
191+
def sourcesDir = new File(currentProjectDir, "src/main/rdgen/org/utbot/rd/models")
192+
def rdParams = extensions.getByName("params") as RdGenExtension
193+
194+
group = "rdgen"
195+
rdParams.verbose = true
196+
rdParams.sources(sourcesDir)
197+
rdParams.hashFolder = hashDir.canonicalPath
198+
rdParams.packages = "org.utbot.rd.models"
199+
200+
rdParams.generator {
201+
language = "csharp"
202+
transform = "symmetric"
203+
root = "org.utbot.rd.models.CSharpRoot"
204+
205+
directory = generatedOutputDir.canonicalPath
206+
namespace = "UtBot.Rd.Generated"
207+
}
184208
}

utbot-rd/src/main/kotlin/org/utbot/rd/generated/SettingsModel.Generated.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,10 @@ class SettingsModel private constructor(
4343
fun create(lifetime: Lifetime, protocol: IProtocol): SettingsModel {
4444
SettingsRoot.register(protocol.serializers)
4545

46-
return SettingsModel()
46+
return SettingsModel().apply {
47+
identify(protocol.identity, RdId.Null.mix("SettingsModel"))
48+
bind(lifetime, protocol, "SettingsModel")
49+
}
4750
}
4851

4952

utbot-rd/src/main/kotlin/org/utbot/rd/generated/SynchronizationModel.Generated.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ class SynchronizationModel private constructor(
4141
fun create(lifetime: Lifetime, protocol: IProtocol): SynchronizationModel {
4242
SynchronizationRoot.register(protocol.serializers)
4343

44-
return SynchronizationModel()
44+
return SynchronizationModel().apply {
45+
identify(protocol.identity, RdId.Null.mix("SynchronizationModel"))
46+
bind(lifetime, protocol, "SynchronizationModel")
47+
}
4548
}
4649

4750

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@file:Suppress("unused")
2+
package org.utbot.rd.models
3+
4+
import com.jetbrains.rd.generator.nova.*
5+
6+
object CSharpRoot: Root()
7+
8+
object VSharpModel: Ext(CSharpRoot) {
9+
val generateArguments = structdef {
10+
field("assemblyPath", PredefinedType.string)
11+
field("projectCsprojPath", PredefinedType.string)
12+
field("solutionFilePath", PredefinedType.string)
13+
field("moduleFqnName", PredefinedType.string)
14+
field("methodToken", PredefinedType.int)
15+
field("generationTimeoutInSeconds", PredefinedType.int)
16+
}
17+
18+
val generateResults = structdef {
19+
field("generatedProjectPath", PredefinedType.string)
20+
field("generatedFilesPaths", array(PredefinedType.string))
21+
}
22+
23+
init {
24+
call("generate", generateArguments, generateResults).async
25+
signal("ping", PredefinedType.string).async
26+
}
27+
}

utbot-rd/src/main/rdgen/org/utbot/rd/models/EngineProcessModel.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@file:Suppress("unused")
12
package org.utbot.rd.models
23

34
import com.jetbrains.rd.generator.nova.*

utbot-rd/src/main/rdgen/org/utbot/rd/models/InstrumentedProcessModel.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@file:Suppress("unused")
12
package org.utbot.rd.models
23

34
import com.jetbrains.rd.generator.nova.*

utbot-rd/src/main/rdgen/org/utbot/rd/models/SettingsModel.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@file:Suppress("unused")
2+
13
package org.utbot.rd.models
24

35
import com.jetbrains.rd.generator.nova.*

utbot-rd/src/main/rdgen/org/utbot/rd/models/SynchronizationModel.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@file:Suppress("unused")
12
package org.utbot.rd.models
23

34
import com.jetbrains.rd.generator.nova.*

0 commit comments

Comments
 (0)