Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[utbot-rider]
1. introducing first version of UtBot for Rider, based on VSharp symbolic
engine
2. Added `Run Rider` run configuration
  • Loading branch information
Domonion committed Dec 6, 2022
commit 8bf46c1032018db8f411803fd7a28fd570303ab5
2 changes: 1 addition & 1 deletion .run/Run IDE.run.xml → .run/Run IDEA.run.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run IDE" type="GradleRunConfiguration" factoryName="Gradle">
<configuration default="false" name="Run IDEA" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/utbot-intellij" />
Expand Down
23 changes: 23 additions & 0 deletions .run/Run Rider.run.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Run Rider" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/utbot-rider" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="-PincludeRiderInBuild=true" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="runIde" />
</list>
</option>
<option name="vmOptions" />
</ExternalSystemSettings>
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess>
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess>
<DebugAllEnabled>false</DebugAllEnabled>
<method v="2" />
</configuration>
</component>
18 changes: 16 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,14 @@ collectionsVersion=0.3.4
# as they cannot be set from properties
# utbot-intellij/build.gradle.kts
# utbot-rd/build.gradle
rdVersion=2022.3.4
# utbot-rider/build.gradle.kts
intellijPluginVersion=1.7.0
# every time you bump rd version:
# 1. regenerate all models
# 2. check if rider plugin works
rdVersion=2022.2.1
# to enable - add -PincludeRiderInBuild=true in build CLI
includeRiderInBuild=false
jacocoVersion=0.8.8
commonsLangVersion=3.11
commonsIoVersion=2.8.0
Expand Down Expand Up @@ -68,9 +74,17 @@ shadowJarVersion=7.1.2
openblasVersion=0.3.10-1.5.4
arpackNgVersion=3.7.0-1.5.4

# configuration for build server
org.gradle.daemon=false
org.gradle.parallel=false
org.gradle.jvmargs="-XX:MaxHeapSize=6144m"
kotlin.compiler.execution.strategy=in-process
org.gradle.caching=false

org.gradle.caching=false
# configuration for local compilation - much faster
#org.gradle.daemon=true
#kotlin.daemon.jvm.options=-Xmx4g
#org.gradle.parallel=true
#org.gradle.caching=true
#org.gradle.workers.max=8
#org.gradle.jvmargs="-XX:MaxHeapSize=6144m"
5 changes: 5 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ val ideType: String by settings

val pythonIde: String by settings
val jsIde: String by settings
val includeRiderInBuild: String by settings

pluginManagement {
resolutionStrategy {
Expand Down Expand Up @@ -40,6 +41,10 @@ include("utbot-testing")
include("utbot-rd")
include("utbot-android-studio")

if (includeRiderInBuild.toBoolean()) {
include("utbot-rider")
}

include("utbot-ui-commons")

if (pythonIde.split(",").contains(ideType)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ class EngineProcessModel private constructor(
fun create(lifetime: Lifetime, protocol: IProtocol): EngineProcessModel {
EngineProcessRoot.register(protocol.serializers)

return EngineProcessModel()
return EngineProcessModel().apply {
identify(protocol.identity, RdId.Null.mix("EngineProcessModel"))
bind(lifetime, protocol, "EngineProcessModel")
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ class RdInstrumenterAdapter private constructor(
fun create(lifetime: Lifetime, protocol: IProtocol): RdInstrumenterAdapter {
EngineProcessRoot.register(protocol.serializers)

return RdInstrumenterAdapter()
return RdInstrumenterAdapter().apply {
identify(protocol.identity, RdId.Null.mix("RdInstrumenterAdapter"))
bind(lifetime, protocol, "RdInstrumenterAdapter")
}
}

private val __StringNullableSerializer = FrameworkMarshallers.String.nullable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,10 @@ class RdSourceFindingStrategy private constructor(
fun create(lifetime: Lifetime, protocol: IProtocol): RdSourceFindingStrategy {
EngineProcessRoot.register(protocol.serializers)

return RdSourceFindingStrategy()
return RdSourceFindingStrategy().apply {
identify(protocol.identity, RdId.Null.mix("RdSourceFindingStrategy"))
bind(lifetime, protocol, "RdSourceFindingStrategy")
}
}

private val __StringNullableSerializer = FrameworkMarshallers.String.nullable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ class InstrumentedProcessModel private constructor(
fun create(lifetime: Lifetime, protocol: IProtocol): InstrumentedProcessModel {
InstrumentedProcessRoot.register(protocol.serializers)

return InstrumentedProcessModel()
return InstrumentedProcessModel().apply {
identify(protocol.identity, RdId.Null.mix("InstrumentedProcessModel"))
bind(lifetime, protocol, "InstrumentedProcessModel")
}
}


Expand Down
26 changes: 25 additions & 1 deletion utbot-rd/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'com.jetbrains.rdgen' version "2022.3.4"
id 'com.jetbrains.rdgen' version "2022.2.1"
}

import com.jetbrains.rd.generator.gradle.RdGenExtension
Expand Down Expand Up @@ -181,4 +181,28 @@ task generateCommonModels(type: RdGenTask) {
directory = generatedOutputDir.canonicalPath
namespace = "org.utbot.rd.generated"
}
}

task generateCSharpModels(type: RdGenTask) {
def currentProjectDir = project.projectDir
def riderPluginProjectDir = project.rootProject.projectDir.toPath().resolve("utbot-rider").toFile()
def generatedOutputDir = new File (riderPluginProjectDir, "src/dotnet/UtBot/UtBot.Rd/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
rdParams.packages = "org.utbot.rd.models"

rdParams.generator {
language = "csharp"
transform = "symmetric"
root = "org.utbot.rd.models.CSharpRoot"

directory = generatedOutputDir.canonicalPath
namespace = "UtBot.Rd.Generated"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ class SettingsModel private constructor(
fun create(lifetime: Lifetime, protocol: IProtocol): SettingsModel {
SettingsRoot.register(protocol.serializers)

return SettingsModel()
return SettingsModel().apply {
identify(protocol.identity, RdId.Null.mix("SettingsModel"))
bind(lifetime, protocol, "SettingsModel")
}
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ class SynchronizationModel private constructor(
fun create(lifetime: Lifetime, protocol: IProtocol): SynchronizationModel {
SynchronizationRoot.register(protocol.serializers)

return SynchronizationModel()
return SynchronizationModel().apply {
identify(protocol.identity, RdId.Null.mix("SynchronizationModel"))
bind(lifetime, protocol, "SynchronizationModel")
}
}


Expand Down
27 changes: 27 additions & 0 deletions utbot-rd/src/main/rdgen/org/utbot/rd/models/CSharpModel.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@file:Suppress("unused")
package org.utbot.rd.models

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

object CSharpRoot: Root()

object VSharpModel: Ext(CSharpRoot) {
val generateArguments = structdef {
field("assemblyPath", PredefinedType.string)
field("projectCsprojPath", PredefinedType.string)
field("solutionFilePath", PredefinedType.string)
field("moduleFqnName", PredefinedType.string)
field("methodToken", PredefinedType.int)
field("generationTimeoutInSeconds", PredefinedType.int)
}

val generateResults = structdef {
field("generatedProjectPath", PredefinedType.string)
field("generatedFilesPaths", array(PredefinedType.string))
}

init {
call("generate", generateArguments, generateResults).async
signal("ping", PredefinedType.string).async
}
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@file:Suppress("unused")
package org.utbot.rd.models

import com.jetbrains.rd.generator.nova.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@file:Suppress("unused")
package org.utbot.rd.models

import com.jetbrains.rd.generator.nova.*
Expand Down
2 changes: 2 additions & 0 deletions utbot-rd/src/main/rdgen/org/utbot/rd/models/SettingsModel.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:Suppress("unused")

package org.utbot.rd.models

import com.jetbrains.rd.generator.nova.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@file:Suppress("unused")
package org.utbot.rd.models

import com.jetbrains.rd.generator.nova.*
Expand Down
Loading