Skip to content

Commit 1bcd321

Browse files
committed
[utbot-spring]
Fixing gradle and rd builds
1 parent aeed41d commit 1bcd321

File tree

9 files changed

+37
-21
lines changed

9 files changed

+37
-21
lines changed

build.gradle.kts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ plugins {
1919
`maven-publish`
2020
}
2121

22-
configure<JavaPluginExtension> {
23-
sourceCompatibility = VERSION_11
24-
targetCompatibility = VERSION_17
25-
}
26-
2722
allprojects {
2823

2924
apply {

utbot-framework/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ dependencies {
3838

3939
implementation group: 'com.github.UnitTestBot.ksmt', name: 'ksmt-core', version: ksmtVersion
4040
implementation group: 'com.github.UnitTestBot.ksmt', name: 'ksmt-z3', version: ksmtVersion
41+
implementation project(':utbot-spring-analyzer')
4142

4243
fetchSpringAnalyzerJar project(path: ':utbot-spring-analyzer', configuration: 'springAnalyzerJar')
4344
}

utbot-framework/src/main/kotlin/org/utbot/framework/process/EngineProcessMain.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ import org.utbot.rd.loggers.UtRdKLoggerFactory
3737
import org.utbot.rd.terminateOnException
3838
import org.utbot.sarif.RdSourceFindingStrategyFacade
3939
import org.utbot.sarif.SarifReport
40+
import org.utbot.spring.process.SpringAnalyzerProcess
4041
import org.utbot.summary.summarizeAll
4142
import java.io.File
4243
import java.net.URLClassLoader

utbot-rd/build.gradle

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,14 +255,30 @@ task generateCommonModels(type: RdGenTask) {
255255
directory = generatedOutputDir.canonicalPath
256256
namespace = "org.utbot.rd.generated"
257257
}
258+
}
259+
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
267+
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"
258274

259275
rdParams.generator {
260276
language = "kotlin"
261277
transform = "symmetric"
262278
root = "org.utbot.rd.models.SpringAnalyzerRoot"
263279

264280
directory = generatedOutputDir.canonicalPath
265-
namespace = "org.utbot.rd.generated"
281+
namespace = "org.utbot.spring.generated"
266282
}
267283
}
268284

utbot-spring-analyzer/build.gradle.kts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,31 @@ import com.github.jengelman.gradle.plugins.shadow.transformers.PropertiesFileTra
33

44
val rdVersion: String by rootProject
55
val commonsLoggingVersion: String by rootProject
6+
val kotlinLoggingVersion: String by rootProject
67

78
plugins {
8-
id("org.springframework.boot") version "2.7.8"
9-
id("io.spring.dependency-management") version "1.1.0"
109
id("com.github.johnrengelman.shadow") version "7.1.2"
1110
id("java")
1211
application
1312
}
1413

1514
java {
16-
sourceCompatibility = JavaVersion.VERSION_11
17-
targetCompatibility = JavaVersion.VERSION_17
15+
sourceCompatibility = JavaVersion.VERSION_1_8
16+
targetCompatibility = JavaVersion.VERSION_1_8
1817
}
1918

2019
dependencies {
21-
implementation("org.springframework.boot:spring-boot-starter")
22-
implementation("org.springframework.boot:spring-boot-starter-web")
20+
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot
21+
implementation("org.springframework.boot:spring-boot:2.7.8")
2322

2423
implementation(project(":utbot-rd"))
2524
implementation(project(":utbot-core"))
25+
implementation(project(":utbot-framework-api"))
2626
implementation("com.jetbrains.rd:rd-framework:$rdVersion")
2727
implementation("com.jetbrains.rd:rd-core:$rdVersion")
2828
implementation("commons-logging:commons-logging:$commonsLoggingVersion")
29+
implementation("io.github.microutils:kotlin-logging:$kotlinLoggingVersion")
30+
implementation("commons-io:commons-io:2.11.0")
2931
}
3032

3133
application {

utbot-rd/src/main/kotlin/org/utbot/rd/generated/SpringAnalyzerProcessModel.Generated.kt renamed to utbot-spring-analyzer/src/main/kotlin/org/utbot/spring/generated/SpringAnalyzerProcessModel.Generated.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@file:Suppress("EXPERIMENTAL_API_USAGE","EXPERIMENTAL_UNSIGNED_LITERALS","PackageDirectoryMismatch","UnusedImport","unused","LocalVariableName","CanBeVal","PropertyName","EnumEntryName","ClassName","ObjectPropertyName","UnnecessaryVariable","SpellCheckingInspection")
2-
package org.utbot.rd.generated
2+
package org.utbot.spring.generated
33

44
import com.jetbrains.rd.framework.*
55
import com.jetbrains.rd.framework.base.*

utbot-rd/src/main/kotlin/org/utbot/rd/generated/SpringAnalyzerRoot.Generated.kt renamed to utbot-spring-analyzer/src/main/kotlin/org/utbot/spring/generated/SpringAnalyzerRoot.Generated.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@file:Suppress("EXPERIMENTAL_API_USAGE","EXPERIMENTAL_UNSIGNED_LITERALS","PackageDirectoryMismatch","UnusedImport","unused","LocalVariableName","CanBeVal","PropertyName","EnumEntryName","ClassName","ObjectPropertyName","UnnecessaryVariable","SpellCheckingInspection")
2-
package org.utbot.rd.generated
2+
package org.utbot.spring.generated
33

44
import com.jetbrains.rd.framework.*
55
import com.jetbrains.rd.framework.base.*

utbot-framework/src/main/kotlin/org/utbot/framework/process/SpringAnalyzerProcess.kt renamed to utbot-spring-analyzer/src/main/kotlin/org/utbot/spring/process/SpringAnalyzerProcess.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package org.utbot.framework.process
1+
package org.utbot.spring.process
22

33
import com.jetbrains.rd.util.lifetime.LifetimeDefinition
44
import kotlinx.coroutines.runBlocking
@@ -7,6 +7,7 @@ import org.apache.commons.io.FileUtils
77
import org.utbot.common.getPid
88
import org.utbot.common.utBotTempDirectory
99
import org.utbot.framework.UtSettings
10+
import org.utbot.framework.process.AbstractRDProcessCompanion
1011
import org.utbot.rd.ProcessWithRdServer
1112
import org.utbot.rd.exceptions.InstantProcessDeathException
1213
import org.utbot.rd.generated.LoggerModel
@@ -17,9 +18,9 @@ import org.utbot.rd.onSchedulerBlocking
1718
import org.utbot.rd.startBlocking
1819
import org.utbot.rd.startUtProcessWithRdServer
1920
import org.utbot.rd.terminateOnException
20-
import org.utbot.rd.generated.SpringAnalyzerParams
21-
import org.utbot.rd.generated.SpringAnalyzerProcessModel
22-
import org.utbot.rd.generated.springAnalyzerProcessModel
21+
import org.utbot.spring.generated.SpringAnalyzerParams
22+
import org.utbot.spring.generated.SpringAnalyzerProcessModel
23+
import org.utbot.spring.generated.springAnalyzerProcessModel
2324
import java.nio.file.Files
2425

2526
class SpringAnalyzerProcessInstantDeathException :

utbot-spring-analyzer/src/main/kotlin/org/utbot/spring/process/SpringAnalyzerProcessMain.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ import org.utbot.rd.generated.settingsModel
1717
import org.utbot.rd.loggers.UtRdRemoteLoggerFactory
1818
import org.utbot.spring.analyzers.SpringApplicationAnalyzer
1919
import org.utbot.spring.data.ApplicationData
20-
import org.utbot.rd.generated.SpringAnalyzerProcessModel
21-
import org.utbot.rd.generated.SpringAnalyzerResult
22-
import org.utbot.rd.generated.springAnalyzerProcessModel
20+
import org.utbot.spring.generated.SpringAnalyzerProcessModel
21+
import org.utbot.spring.generated.SpringAnalyzerResult
22+
import org.utbot.spring.generated.springAnalyzerProcessModel
2323
import java.io.File
2424
import kotlin.time.Duration.Companion.seconds
2525

0 commit comments

Comments
 (0)