Skip to content

Commit 9675f9b

Browse files
committed
Extract utbot-spring-framework module from utbot-framework-module
Remove duplicated `include("utbot-spring-framework")` in `settings.gradle.kts`
1 parent 621b1b0 commit 9675f9b

34 files changed

+50
-28
lines changed

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ if (includeRiderInBuild.toBoolean()) {
5656

5757
include("utbot-ui-commons")
5858

59+
include("utbot-spring-framework")
5960
include("utbot-spring-commons-api")
6061
include("utbot-spring-commons")
6162
include("utbot-spring-analyzer")

utbot-framework/build.gradle

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ plugins {
33
}
44

55
configurations {
6-
fetchSpringAnalyzerJar
7-
fetchSpringCommonsJar
86
fetchInstrumentationJar
7+
fetchSpringAnalyzerJar
98
}
109

1110
dependencies {
@@ -52,7 +51,6 @@ dependencies {
5251
implementation project(':utbot-spring-commons-api')
5352
implementation project(':utbot-spring-analyzer')
5453
fetchSpringAnalyzerJar project(path: ':utbot-spring-analyzer', configuration: 'springAnalyzerJar')
55-
fetchSpringCommonsJar project(path: ':utbot-spring-commons', configuration: 'springCommonsJar')
5654
}
5755

5856
processResources {
@@ -63,8 +61,4 @@ processResources {
6361
from(configurations.fetchSpringAnalyzerJar) {
6462
into "lib"
6563
}
66-
67-
from(configurations.fetchSpringCommonsJar) {
68-
into "lib"
69-
}
7064
}

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/domain/builtin/MockitoBuiltins.kt

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,6 @@ internal val mockitoClassId = BuiltinClassId(
2020
simpleName = "Mockito",
2121
)
2222

23-
internal val mockClassId = BuiltinClassId(
24-
canonicalName = "org.mockito.Mock",
25-
simpleName = "Mock",
26-
)
27-
28-
internal val spyClassId = BuiltinClassId(
29-
canonicalName = "org.mockito.Spy",
30-
simpleName = "Spy"
31-
)
32-
33-
internal val injectMocksClassId = BuiltinClassId(
34-
canonicalName = "org.mockito.InjectMocks",
35-
simpleName = "InjectMocks",
36-
)
37-
3823
internal val ongoingStubbingClassId = BuiltinClassId(
3924
canonicalName = "org.mockito.stubbing.OngoingStubbing",
4025
simpleName = "OngoingStubbing",

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/domain/builtin/UtilMethodBuiltins.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ internal class UtilClassFileMethodProvider(language: CodegenLanguage)
278278
val UTIL_CLASS_VERSION = "2.1"
279279
}
280280

281-
internal class TestClassUtilMethodProvider(testClassId: ClassId) : UtilMethodProvider(testClassId)
281+
class TestClassUtilMethodProvider(testClassId: ClassId) : UtilMethodProvider(testClassId)
282282

283283
internal fun selectUtilClassId(codegenLanguage: CodegenLanguage): ClassId =
284284
when (codegenLanguage) {

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/services/access/CgCallableAccessManager.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ interface CgCallableAccessManager {
8787
operator fun ClassId.get(fieldId: FieldId): CgStaticFieldAccess
8888
}
8989

90-
internal class CgCallableAccessManagerImpl(val context: CgContext) : CgCallableAccessManager,
90+
class CgCallableAccessManagerImpl(val context: CgContext) : CgCallableAccessManager,
9191
CgContextOwner by context {
9292

9393
private val statementConstructor by lazy { getStatementConstructorBy(context) }

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/ConstructorUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ fun CgContextOwner.importIfNeeded(type: ClassId) {
255255
}
256256
}
257257

258-
internal fun CgContextOwner.importIfNeeded(method: MethodId) {
258+
fun CgContextOwner.importIfNeeded(method: MethodId) {
259259
val name = method.name
260260
val packageName = method.classId.packageName
261261
method.takeIf { it.isStatic && packageName != testClassPackageName && packageName != "java.lang" }

utbot-framework/src/main/kotlin/org/utbot/framework/codegen/tree/ututils/UtilClassKind.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ sealed class UtilClassKind(
120120
* @return `null` if [CgContext.utilMethodProvider] is not [UtilClassFileMethodProvider],
121121
* because it means that util methods will be taken from some other provider (e.g. [TestClassUtilMethodProvider]).
122122
*/
123-
internal fun fromCgContextOrNull(context: CgContext): UtilClassKind? {
123+
fun fromCgContextOrNull(context: CgContext): UtilClassKind? {
124124
if (context.requiredUtilMethods.isEmpty()) return null
125125
if (!context.mockFrameworkUsed) {
126126
return RegularUtUtils(context.codegenLanguage)

utbot-intellij/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ dependencies {
157157
implementation(group = "com.fasterxml.jackson.module", name = "jackson-module-kotlin", version = jacksonVersion)
158158

159159
implementation(project(":utbot-framework")) { exclude(group = "org.slf4j", module = "slf4j-api") }
160+
implementation(project(":utbot-spring-framework")) { exclude(group = "org.slf4j", module = "slf4j-api") }
160161
implementation(project(":utbot-java-fuzzing"))
161162
//api(project(":utbot-analytics"))
162163
testImplementation("org.mock-server:mockserver-netty:5.4.1")
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
val kotlinLoggingVersion: String by rootProject
2+
val sootVersion: String by rootProject
3+
4+
val fetchSpringCommonsJar: Configuration by configurations.creating {
5+
isCanBeResolved = true
6+
isCanBeConsumed = false
7+
}
8+
9+
dependencies {
10+
implementation(project(":utbot-framework"))
11+
implementation(project(":utbot-spring-commons-api"))
12+
implementation(group = "io.github.microutils", name = "kotlin-logging", version = kotlinLoggingVersion)
13+
implementation("org.unittestbot.soot:soot-utbot-fork:${sootVersion}") {
14+
exclude(group = "com.google.guava", module = "guava")
15+
}
16+
17+
fetchSpringCommonsJar(project(":utbot-spring-commons", configuration = "springCommonsJar"))
18+
}
19+
20+
tasks.processResources {
21+
from(fetchSpringCommonsJar) {
22+
into("lib")
23+
}
24+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package org.utbot.framework.codegen.domain.builtin
2+
3+
import org.utbot.framework.plugin.api.BuiltinClassId
4+
5+
internal val mockClassId = BuiltinClassId(
6+
canonicalName = "org.mockito.Mock",
7+
simpleName = "Mock",
8+
)
9+
10+
internal val spyClassId = BuiltinClassId(
11+
canonicalName = "org.mockito.Spy",
12+
simpleName = "Spy"
13+
)
14+
15+
internal val injectMocksClassId = BuiltinClassId(
16+
canonicalName = "org.mockito.InjectMocks",
17+
simpleName = "InjectMocks",
18+
)
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package org.utbot.framework.codegen.tree.fieldmanager
22

33
import org.utbot.framework.codegen.domain.builtin.injectMocksClassId
4-
import org.utbot.framework.codegen.domain.builtin.mockClassId
5-
import org.utbot.framework.codegen.domain.builtin.spyClassId
64
import org.utbot.framework.codegen.domain.context.CgContext
75
import org.utbot.framework.codegen.domain.models.CgFieldDeclaration
86
import org.utbot.framework.codegen.domain.models.CgValue

utbot-spring-test/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
dependencies {
22
testImplementation(project(":utbot-framework"))
3+
testImplementation(project(":utbot-spring-framework"))
34
testImplementation project(':utbot-testing')
45
testImplementation project(':utbot-spring-sample')
56

0 commit comments

Comments
 (0)