@@ -68,7 +68,7 @@ internal class ConanV1Handler(private val conan: Conan) : ConanVersionHandler {
6868 ).requireSuccess()
6969 }
7070
71- val pkgInfos = parsePackageInfos (jsonFile).also { jsonFile.parentFile.safeDeleteRecursively() }
71+ val pkgInfos = parsePackageInfosV1 (jsonFile).also { jsonFile.parentFile.safeDeleteRecursively() }
7272
7373 val packageList = removeProjectPackage(pkgInfos, definitionFile.name)
7474 val packages = parsePackages(packageList, workingDir)
@@ -122,7 +122,7 @@ internal class ConanV1Handler(private val conan: Conan) : ConanVersionHandler {
122122 /* *
123123 * Return the map of packages and their identifiers which are contained in [pkgInfos].
124124 */
125- private fun parsePackages (pkgInfos : List <PackageInfo >, workingDir : File ): Map <String , Package > =
125+ private fun parsePackages (pkgInfos : List <PackageInfoV1 >, workingDir : File ): Map <String , Package > =
126126 pkgInfos.associate { pkgInfo ->
127127 val pkg = parsePackage(pkgInfo, workingDir)
128128 " ${pkg.id.name} :${pkg.id.version} " to pkg
@@ -131,7 +131,7 @@ internal class ConanV1Handler(private val conan: Conan) : ConanVersionHandler {
131131 /* *
132132 * Return the [Package] parsed from the given [pkgInfo].
133133 */
134- private fun parsePackage (pkgInfo : PackageInfo , workingDir : File ): Package {
134+ private fun parsePackage (pkgInfo : PackageInfoV1 , workingDir : File ): Package {
135135 val homepageUrl = pkgInfo.homepage.orEmpty()
136136
137137 val id = parsePackageId(pkgInfo, workingDir)
@@ -153,7 +153,7 @@ internal class ConanV1Handler(private val conan: Conan) : ConanVersionHandler {
153153 /* *
154154 * Return the [Identifier] for the package contained in [pkgInfo].
155155 */
156- private fun parsePackageId (pkgInfo : PackageInfo , workingDir : File ) =
156+ private fun parsePackageId (pkgInfo : PackageInfoV1 , workingDir : File ) =
157157 Identifier (
158158 type = " Conan" ,
159159 namespace = " " ,
@@ -170,7 +170,7 @@ internal class ConanV1Handler(private val conan: Conan) : ConanVersionHandler {
170170 * TODO: The format of `conan info` output for a conanfile.txt file may be such that we can get project metadata
171171 * from the `requires` field. Need to investigate whether this is a sure thing before implementing.
172172 */
173- private fun generateProjectPackage (pkgInfo : PackageInfo , definitionFile : File , workingDir : File ): Package {
173+ private fun generateProjectPackage (pkgInfo : PackageInfoV1 , definitionFile : File , workingDir : File ): Package {
174174 fun inspectPyFile (field : String ) =
175175 definitionFile.name.takeIf { it == " conanfile.py" }?.let { conan.inspectField(it, workingDir, field) }
176176
@@ -195,7 +195,7 @@ internal class ConanV1Handler(private val conan: Conan) : ConanVersionHandler {
195195 * Return the dependency tree for the given [direct scope dependencies][requires].
196196 */
197197 private fun parseDependencyTree (
198- pkgInfos : List <PackageInfo >,
198+ pkgInfos : List <PackageInfoV1 >,
199199 requires : List <String >,
200200 workingDir : File
201201 ): Set <PackageReference > =
@@ -217,13 +217,13 @@ internal class ConanV1Handler(private val conan: Conan) : ConanVersionHandler {
217217/* *
218218 * Return the full list of packages, excluding the project level information.
219219 */
220- private fun removeProjectPackage (pkgInfos : List <PackageInfo >, definitionFileName : String ): List <PackageInfo > =
220+ private fun removeProjectPackage (pkgInfos : List <PackageInfoV1 >, definitionFileName : String ): List <PackageInfoV1 > =
221221 pkgInfos.minusElement(findProjectPackageInfo(pkgInfos, definitionFileName))
222222
223223/* *
224224 * Find the [PackageInfo] that represents the project defined in the definition file.
225225 */
226- private fun findProjectPackageInfo (pkgInfos : List <PackageInfo >, definitionFileName : String ): PackageInfo =
226+ private fun findProjectPackageInfo (pkgInfos : List <PackageInfoV1 >, definitionFileName : String ): PackageInfoV1 =
227227 pkgInfos.first {
228228 // Use "in" because conanfile.py's reference string often includes other data.
229229 definitionFileName in it.reference.orEmpty()
0 commit comments