• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright 2016-2019 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(compile) // 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}
26
27jar {
28    manifest {
29        attributes "Premain-Class": "kotlinx.coroutines.debug.AgentPremain"
30        attributes "Can-Redefine-Classes": "true"
31    }
32}
33
34shadowJar {
35    classifier null
36    // Shadow only byte buddy, do not package kotlin stdlib
37    configurations = [project.configurations.shadowDeps]
38    relocate 'net.bytebuddy', 'kotlinx.coroutines.repackaged.net.bytebuddy'
39}
40