From 5ee17c0c26a2b668b7f0acb0e4c37708ac53bc0c Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Thu, 23 Apr 2015 23:00:34 +0300 Subject: [PATCH] Remove deprecated split usages in build-protobuf-lite script. --- generators/infrastructure/build-protobuf-lite.kts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/generators/infrastructure/build-protobuf-lite.kts b/generators/infrastructure/build-protobuf-lite.kts index cebe6a332a1..d39b5fa2c06 100644 --- a/generators/infrastructure/build-protobuf-lite.kts +++ b/generators/infrastructure/build-protobuf-lite.kts @@ -50,7 +50,7 @@ fun main(args: Array) { val keepClasses = arrayListOf() val pomBytes = allFiles[POM_PATH]?.second ?: error("pom.xml is not found in protobuf jar at $POM_PATH") - val lines = String(pomBytes).split("\n") + val lines = String(pomBytes).lines() var liteProfileReached = false for (lineUntrimmed in lines) { @@ -65,7 +65,7 @@ fun main(args: Array) { } if (liteProfileReached && line.startsWith(INCLUDE_START) && line.endsWith(INCLUDE_END)) { - keepClasses.add(line.substringAfter(INCLUDE_START).substringBeforeLast(INCLUDE_END)) + keepClasses.add(line.removeSurrounding(INCLUDE_START, INCLUDE_END)) } }