blob: ab7f28c6a8b6019fc9cd5adfd57c553d3ab83cf4 [file] [log] [blame]
Vsevolod Tolstopyatovc7239ac2018-12-10 11:41:00 +03001/*
Vsevolod Tolstopyatov6d1a6e32020-02-18 15:28:00 +03002 * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
Vsevolod Tolstopyatovc7239ac2018-12-10 11:41:00 +03003 */
4
Vsevolod Tolstopyatov3781a822018-12-13 11:58:29 +03005apply plugin: "com.github.johnrengelman.shadow"
6
Roman Elizarovd2f4b2b2019-09-02 17:22:39 +03007configurations {
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 */
dkhalanskyjb02b403d2020-04-06 16:33:22 +030017 shadow.extendsFrom(api) // shadow - resulting configuration with shaded jar file
Roman Elizarovd2f4b2b2019-09-02 17:22:39 +030018 configureKotlinJvmPlatform(shadow)
19}
20
Vsevolod Tolstopyatovc7239ac2018-12-10 11:41:00 +030021dependencies {
Vsevolod Tolstopyatov2bdd4602019-02-20 17:00:57 +030022 compileOnly "junit:junit:$junit_version"
Roman Elizarovd2f4b2b2019-09-02 17:22:39 +030023 shadowDeps "net.bytebuddy:byte-buddy:$byte_buddy_version"
24 shadowDeps "net.bytebuddy:byte-buddy-agent:$byte_buddy_version"
dkhalanskyjb02b403d2020-04-06 16:33:22 +030025 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"
Vsevolod Tolstopyatovc7239ac2018-12-10 11:41:00 +030029}
30
31jar {
32 manifest {
33 attributes "Premain-Class": "kotlinx.coroutines.debug.AgentPremain"
34 attributes "Can-Redefine-Classes": "true"
Vsevolod Tolstopyatovc7239ac2018-12-10 11:41:00 +030035 }
36}
Vsevolod Tolstopyatov3781a822018-12-13 11:58:29 +030037
38shadowJar {
39 classifier null
40 // Shadow only byte buddy, do not package kotlin stdlib
Roman Elizarovd2f4b2b2019-09-02 17:22:39 +030041 configurations = [project.configurations.shadowDeps]
dkhalanskyjb02b403d2020-04-06 16:33:22 +030042 relocate('net.bytebuddy', 'kotlinx.coroutines.repackaged.net.bytebuddy')
Vsevolod Tolstopyatov3781a822018-12-13 11:58:29 +030043}