[Gradle, Cocoapods] Complete logging for corner-case pod configurations
This commit is contained in:
+11
-5
@@ -116,17 +116,23 @@ open class CocoapodsExtension(private val project: Project) {
|
|||||||
val buildScript = project.buildFile
|
val buildScript = project.buildFile
|
||||||
val lines = buildScript.readLines()
|
val lines = buildScript.readLines()
|
||||||
val lineNumber = lines.indexOfFirst { pattern.matches(it) }
|
val lineNumber = lines.indexOfFirst { pattern.matches(it) }
|
||||||
val lineContent = lines[lineNumber].trimIndent()
|
val warnMessage = if (lineNumber != -1) run {
|
||||||
val newContent = lineContent.replace(path.name, "")
|
val lineContent = lines[lineNumber].trimIndent()
|
||||||
project.logger.warn(
|
val newContent = lineContent.replace(path.name, "")
|
||||||
"""
|
"""
|
||||||
|Deprecated DSL used on ${buildScript.absolutePath}${File.pathSeparator}${lineNumber + 1}:
|
|Deprecated DSL found on ${buildScript.absolutePath}${File.pathSeparator}${lineNumber + 1}:
|
||||||
|Found: "${lineContent}"
|
|Found: "${lineContent}"
|
||||||
|Expected: "${newContent}"
|
|Expected: "${newContent}"
|
||||||
|Please, change the path to avoid this warning.
|
|Please, change the path to avoid this warning.
|
||||||
|
|
|
|
||||||
""".trimMargin()
|
""".trimMargin()
|
||||||
)
|
} else
|
||||||
|
"""
|
||||||
|
|Deprecated DSL is used for pod "$name".
|
||||||
|
|Please, change its path from ${path.path} to ${path.parentFile.path}
|
||||||
|
|
|
||||||
|
""".trimMargin()
|
||||||
|
project.logger.warn(warnMessage)
|
||||||
podSource = path.parentFile
|
podSource = path.parentFile
|
||||||
}
|
}
|
||||||
addToPods(CocoapodsDependency(name, moduleName, version, podSource?.let { Path(it) }))
|
addToPods(CocoapodsDependency(name, moduleName, version, podSource?.let { Path(it) }))
|
||||||
|
|||||||
Reference in New Issue
Block a user