File tree Expand file tree Collapse file tree
gradle-plugin/src/main/groovy/akka/grpc/gradle Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -162,14 +162,17 @@ class AkkaGrpcPlugin implements Plugin<Project> {
162162
163163 project. task(" printProtocLogs" ) {
164164 doLast {
165- Files . lines(logFile). forEach { line ->
166- if (line. startsWith(" [info]" )) logger. info(line. substring(7 ))
167- else if (line. startsWith(" [debug]" )) logger. debug(line. substring(7 ))
168- else if (line. startsWith(" [warn]" )) logger. warn(line. substring(6 ))
169- else if (line. startsWith(" [error]" )) logger. error(line. substring(7 ))
165+ if (Files . exists(logFile)) {
166+ Files . lines(logFile). forEach { line ->
167+ if (line. startsWith(" [info]" )) logger. info(line. substring(7 ))
168+ else if (line. startsWith(" [debug]" )) logger. debug(line. substring(7 ))
169+ else if (line. startsWith(" [warn]" )) logger. warn(line. substring(6 ))
170+ else if (line. startsWith(" [error]" )) logger. error(line. substring(7 ))
171+ }
170172 }
171173 }
172174 }
175+ project. getTasks(). getByName(" printProtocLogs" ). dependsOn(" generateProto" )
173176 project. getTasks(). getByName(" compileJava" ). dependsOn(" printProtocLogs" ) // TODO logs for multi project builds
174177
175178 }
You can’t perform that action at this time.
0 commit comments