1/* 2 * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. 3 */ 4 5apply plugin: "com.github.johnrengelman.shadow" 6 7configurations { 8 shadowDeps // shaded dependencies, not included into the resulting .pom file 9 compileOnly.extendsFrom(shadowDeps) 10 runtimeOnly.extendsFrom(shadowDeps) 11 12 /* 13 * It is possible to extend a particular configuration with shadow, 14 * but in that case it changes dependency type to "runtime" and resolves it 15 * (so it cannot be further modified). Otherwise, shadow just ignores all dependencies. 16 */ 17 shadow.extendsFrom(api) // shadow - resulting configuration with shaded jar file 18 configureKotlinJvmPlatform(shadow) 19} 20 21dependencies { 22 compileOnly "junit:junit:$junit_version" 23 shadowDeps "net.bytebuddy:byte-buddy:$byte_buddy_version" 24 shadowDeps "net.bytebuddy:byte-buddy-agent:$byte_buddy_version" 25 compileOnly "io.projectreactor.tools:blockhound:$blockhound_version" 26 testCompile "io.projectreactor.tools:blockhound:$blockhound_version" 27 api "net.java.dev.jna:jna:$jna_version" 28 api "net.java.dev.jna:jna-platform:$jna_version" 29} 30 31jar { 32 manifest { 33 attributes "Premain-Class": "kotlinx.coroutines.debug.AgentPremain" 34 attributes "Can-Redefine-Classes": "true" 35 } 36} 37 38shadowJar { 39 classifier null 40 // Shadow only byte buddy, do not package kotlin stdlib 41 configurations = [project.configurations.shadowDeps] 42 relocate('net.bytebuddy', 'kotlinx.coroutines.repackaged.net.bytebuddy') 43} 44