com.ybo.trackingplugin.tasks.utils.impl._CodeGeneratorJava.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of traceplugin Show documentation
Show all versions of traceplugin Show documentation
gradle plugin allowing to add automatic logs (or other process) at the start of each traced method
package com.ybo.trackingplugin.tasks.utils.impl
import com.ybo.trackingplugin.tasks.data.TraceAnnotationMark
import com.ybo.trackingplugin.tasks.utils.CodeGenerator
import com.ybo.trackingplugin.toB64
class _CodeGeneratorJava : CodeGenerator() {
override fun generate(
params: String,
tracerFactoryString: String,
insideMethodIndentation: String,
methodName: String,
tag: String,
alterationOffset: Int,
mark: TraceAnnotationMark,
): String {
return "/*$tag*/ $tracePerformerPackage.INSTANCE.trace(" +
"new " + tracerFactoryString + "(), " +
"\"" + methodName.toB64() + "\", " +
"true, " +
"\"" + mark.longVersion.toB64() + "\"," +
"new Object[]{" + params + "}, " +
alterationOffset +
");\n" +
insideMethodIndentation
}
}