Setup

Configure with gradle as below.

  1. repository: mavenCentral()

  2. plugin

    plugins{
        // Minimum version: kt `1.8.0`, ksp `1.8.0-1.0.9`.  
        // keep the prefix same with your kotlin version.
        // here supposes your kotlin plugin is at '1.8.0'
        id("com.google.devtools.ksp") version "1.8.0-1.0.9"
    }
    
  3. add this part directly, rather than insert messily.

    //region tracer
    // options
    // ksp.arg("tracer.internal", "")
    
    tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
        kotlinOptions.freeCompilerArgs += '-Xcontext-receivers'
    }
    
    dependencies {
        implementation 'io.github.shawxingkwok:tracer-annotations:1.0.0'
        ksp 'io.github.shawxingkwok:tracer-compiler:1.0.0-1.0.0'
    }
    //endregion 
    
    //region tracer
    // options
    // ksp.arg("tracer.internal", "")
    
    tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
        kotlinOptions.freeCompilerArgs += "-Xcontext-receivers"
    }
    
    dependencies {
        implementation ("io.github.shawxingkwok:tracer-annotations:1.0.0")
        ksp ("io.github.shawxingkwok:tracer-compiler:1.0.0-1.0.0")
    }
    //endregion 
    

For the library tracer-compiler, common version styles like 1.0.3 are deprecated. Use 1.0.0-1.0.0 instead, in which the former is anchored to the version of tracer-annotatinos.