Skip to content

Commit

Permalink
[utbot-spring]
Browse files Browse the repository at this point in the history
Fixing gradle and rd builds
  • Loading branch information
Domonion committed Apr 7, 2023
1 parent aeed41d commit 1bcd321
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 21 deletions.
5 changes: 0 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ plugins {
`maven-publish`
}

configure<JavaPluginExtension> {
sourceCompatibility = VERSION_11
targetCompatibility = VERSION_17
}

allprojects {

apply {
Expand Down
1 change: 1 addition & 0 deletions utbot-framework/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ dependencies {

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

fetchSpringAnalyzerJar project(path: ':utbot-spring-analyzer', configuration: 'springAnalyzerJar')
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import org.utbot.rd.loggers.UtRdKLoggerFactory
import org.utbot.rd.terminateOnException
import org.utbot.sarif.RdSourceFindingStrategyFacade
import org.utbot.sarif.SarifReport
import org.utbot.spring.process.SpringAnalyzerProcess
import org.utbot.summary.summarizeAll
import java.io.File
import java.net.URLClassLoader
Expand Down
18 changes: 17 additions & 1 deletion utbot-rd/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -255,14 +255,30 @@ task generateCommonModels(type: RdGenTask) {
directory = generatedOutputDir.canonicalPath
namespace = "org.utbot.rd.generated"
}
}

task generateSpringModels(type: RdGenTask) {
def currentProjectDir = project.projectDir
def ideaPluginProjectDir = project.rootProject.childProjects["utbot-spring-analyzer"].projectDir
def generatedOutputDir = new File(ideaPluginProjectDir, "src/main/kotlin/org/utbot/spring/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
// where to search roots
rdParams.packages = "org.utbot.rd.models"

rdParams.generator {
language = "kotlin"
transform = "symmetric"
root = "org.utbot.rd.models.SpringAnalyzerRoot"

directory = generatedOutputDir.canonicalPath
namespace = "org.utbot.rd.generated"
namespace = "org.utbot.spring.generated"
}
}

Expand Down
14 changes: 8 additions & 6 deletions utbot-spring-analyzer/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,31 @@ import com.github.jengelman.gradle.plugins.shadow.transformers.PropertiesFileTra

val rdVersion: String by rootProject
val commonsLoggingVersion: String by rootProject
val kotlinLoggingVersion: String by rootProject

plugins {
id("org.springframework.boot") version "2.7.8"
id("io.spring.dependency-management") version "1.1.0"
id("com.github.johnrengelman.shadow") version "7.1.2"
id("java")
application
}

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

dependencies {
implementation("org.springframework.boot:spring-boot-starter")
implementation("org.springframework.boot:spring-boot-starter-web")
// https://mvnrepository.com/artifact/org.springframework.boot/spring-boot
implementation("org.springframework.boot:spring-boot:2.7.8")

implementation(project(":utbot-rd"))
implementation(project(":utbot-core"))
implementation(project(":utbot-framework-api"))
implementation("com.jetbrains.rd:rd-framework:$rdVersion")
implementation("com.jetbrains.rd:rd-core:$rdVersion")
implementation("commons-logging:commons-logging:$commonsLoggingVersion")
implementation("io.github.microutils:kotlin-logging:$kotlinLoggingVersion")
implementation("commons-io:commons-io:2.11.0")
}

application {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@file:Suppress("EXPERIMENTAL_API_USAGE","EXPERIMENTAL_UNSIGNED_LITERALS","PackageDirectoryMismatch","UnusedImport","unused","LocalVariableName","CanBeVal","PropertyName","EnumEntryName","ClassName","ObjectPropertyName","UnnecessaryVariable","SpellCheckingInspection")
package org.utbot.rd.generated
package org.utbot.spring.generated

import com.jetbrains.rd.framework.*
import com.jetbrains.rd.framework.base.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@file:Suppress("EXPERIMENTAL_API_USAGE","EXPERIMENTAL_UNSIGNED_LITERALS","PackageDirectoryMismatch","UnusedImport","unused","LocalVariableName","CanBeVal","PropertyName","EnumEntryName","ClassName","ObjectPropertyName","UnnecessaryVariable","SpellCheckingInspection")
package org.utbot.rd.generated
package org.utbot.spring.generated

import com.jetbrains.rd.framework.*
import com.jetbrains.rd.framework.base.*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.utbot.framework.process
package org.utbot.spring.process

import com.jetbrains.rd.util.lifetime.LifetimeDefinition
import kotlinx.coroutines.runBlocking
Expand All @@ -7,6 +7,7 @@ import org.apache.commons.io.FileUtils
import org.utbot.common.getPid
import org.utbot.common.utBotTempDirectory
import org.utbot.framework.UtSettings
import org.utbot.framework.process.AbstractRDProcessCompanion
import org.utbot.rd.ProcessWithRdServer
import org.utbot.rd.exceptions.InstantProcessDeathException
import org.utbot.rd.generated.LoggerModel
Expand All @@ -17,9 +18,9 @@ import org.utbot.rd.onSchedulerBlocking
import org.utbot.rd.startBlocking
import org.utbot.rd.startUtProcessWithRdServer
import org.utbot.rd.terminateOnException
import org.utbot.rd.generated.SpringAnalyzerParams
import org.utbot.rd.generated.SpringAnalyzerProcessModel
import org.utbot.rd.generated.springAnalyzerProcessModel
import org.utbot.spring.generated.SpringAnalyzerParams
import org.utbot.spring.generated.SpringAnalyzerProcessModel
import org.utbot.spring.generated.springAnalyzerProcessModel
import java.nio.file.Files

class SpringAnalyzerProcessInstantDeathException :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ import org.utbot.rd.generated.settingsModel
import org.utbot.rd.loggers.UtRdRemoteLoggerFactory
import org.utbot.spring.analyzers.SpringApplicationAnalyzer
import org.utbot.spring.data.ApplicationData
import org.utbot.rd.generated.SpringAnalyzerProcessModel
import org.utbot.rd.generated.SpringAnalyzerResult
import org.utbot.rd.generated.springAnalyzerProcessModel
import org.utbot.spring.generated.SpringAnalyzerProcessModel
import org.utbot.spring.generated.SpringAnalyzerResult
import org.utbot.spring.generated.springAnalyzerProcessModel
import java.io.File
import kotlin.time.Duration.Companion.seconds

Expand Down

0 comments on commit 1bcd321

Please sign in to comment.