@@ -6,7 +6,6 @@ import org.utbot.common.FileUtil.findAllFilesOnly
6
6
import org.utbot.common.PathUtil.classFqnToPath
7
7
import org.utbot.common.PathUtil.replaceSeparator
8
8
import org.utbot.common.tryLoadClass
9
- import org.utbot.framework.plugin.api.CodegenLanguage
10
9
import org.utbot.framework.plugin.sarif.util.ClassUtil
11
10
import org.utbot.framework.plugin.sarif.TargetClassWrapper
12
11
import java.io.File
@@ -97,33 +96,22 @@ class SourceSetWrapper(
97
96
98
97
/* *
99
98
* Creates and returns a file for a future SARIF report.
100
- * For example, ".../main/ com/qwerty/MainReport.sarif".
99
+ * For example, ".../com/qwerty/MainReport.sarif".
101
100
*/
102
101
private fun createSarifReportFile (classFqn : String ): File {
103
- val relativePath = " ${sourceSet.name} / ${ classFqnToPath(classFqn)} Report.sarif"
102
+ val relativePath = " ${classFqnToPath(classFqn)} Report.sarif"
104
103
val absolutePath = Paths .get(parentProject.generatedSarifDirectory.path, relativePath)
105
104
return absolutePath.toFile().apply { createNewFileWithParentDirectories() }
106
105
}
107
106
108
107
/* *
109
108
* Creates and returns a file for future generated tests.
110
- * For example, ".../java/main/ com/qwerty/MainTest.java".
109
+ * For example, ".../com/qwerty/MainTest.java".
111
110
*/
112
111
private fun createTestsCodeFile (classFqn : String ): File {
113
112
val fileExtension = parentProject.sarifProperties.codegenLanguage.extension
114
- val sourceRoot = parentProject.sarifProperties.codegenLanguage.toSourceRootName()
115
- val relativePath = " $sourceRoot /${sourceSet.name} /${classFqnToPath(classFqn)} Test$fileExtension "
113
+ val relativePath = " ${classFqnToPath(classFqn)} Test$fileExtension "
116
114
val absolutePath = Paths .get(parentProject.generatedTestsDirectory.path, relativePath)
117
115
return absolutePath.toFile().apply { createNewFileWithParentDirectories() }
118
116
}
119
-
120
- /* *
121
- * Returns the source root name by [CodegenLanguage].
122
- */
123
- private fun CodegenLanguage.toSourceRootName (): String =
124
- when (this ) {
125
- CodegenLanguage .JAVA -> " java"
126
- CodegenLanguage .KOTLIN -> " kotlin"
127
- else -> " unknown"
128
- }
129
117
}
0 commit comments