Use

Xuan-Zhang Gong

import gradle plugin

id("tech.medivh.plugin.gradle") version "0.2.0"
id 'tech.medivh.plugin.gradle' version '0.2.0'

WARNING

If you build from source, don't forget to add mavenLocal() in setting.gradle

pluginManagement {
    repositories {
        mavenLocal()
        gradlePluginPortal()
    }
}

config Medivh

You can use Medivh in your Gradle file after build

medivh {
    include("com.example") // your package name here
}
medivh {
    include 'tech.medivh' // your package name here
}

add annotation to your code

package tech.medivh.demo.kotlin
//  package name must be the same as the package name you configured in the gradle file
import tech.medivh.api.DebugTime

class DemoClass {
    @DebugTime
    fun helloWorld(){
        println("Hello World")
    }

}

write test case

import org.junit.jupiter.api.Test

class DemoClassTest{
    
    @Test
    fun testDemo(){
        val demoClass = DemoClass()
        repeat(10){
            demoClass.helloWorld()
        }
    }
}

Run case in your IDE

Run your test

Or run in terminal

./gradlew test

see the console output

you will see output like this:

you can open file:///xxx/report.html to see the report

click the link above, you will see your Medivh report

Complete Example

this is a complete example, you can refer to this exampleopen in new window to use Medivh

Last Updated 10/24/2024, 8:41:54 AM