DEV Community

Query Filter
Query Filter

Posted on

bridge21

shadowJar {
    dependsOn buildAgent, compileAttacher

    archiveBaseName.set('profiler-all-in-one')
    archiveClassifier.set('all')

    from compileAgent.destinationDirectory
    from compileAttacher.destinationDirectory

    // --- STRATEGY: REMOVE JAVA 21 CLASSES ---
    // This stops Shadow 7.0.0 from ever seeing "Version 65" files
    exclude 'META-INF/versions/**'
    exclude '**/module-info.class'

    manifest {
        attributes(
            'Main-Class': 'comet.agent.UniversalAttacher',
            'Premain-Class': 'comet.agent.ProfilerAgent',
            'Agent-Class': 'comet.agent.ProfilerAgent',
            'Can-Retransform-Classes': 'true'
        )
    }

    configurations = [project.configurations.runtimeClasspath]

    // Relocate safely
    relocate 'net.bytebuddy', 'comet.shaded.bytebuddy'
}
Enter fullscreen mode Exit fullscreen mode

Top comments (0)