aboutsummaryrefslogtreecommitdiff
path: root/build.gradle
blob: 19a97b4d17d73f870840179f8750ff76534e3dca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
import org.jetbrains.DependenciesVersionGetter

allprojects {
    ext {
        final String buildNumber = System.getenv("BUILD_NUMBER")
        dokka_version = dokka_version_base + ( buildNumber == null || System.getenv("FORCE_SNAPSHOT") != null ? "-SNAPSHOT" : ".$buildNumber" )
    }

    if (project == rootProject) {
        println "Publication version: $dokka_version"
    }

    group 'org.jetbrains.dokka'
    version dokka_version

    def repo = {
        artifactPattern("https://teamcity.jetbrains.com/guestAuth/repository/download/Kotlin_dev_CompilerAllPlugins/[revision]/internal/[module](.[ext])")
        artifactPattern("https://teamcity.jetbrains.com/guestAuth/repository/download/Kotlin_dev_CompilerAllPlugins/[revision]/[module](.[ext])")
        artifactPattern("https://teamcity.jetbrains.com/guestAuth/repository/download/IntelliJMarkdownParser_Build/[revision]/([module]_[ext]/)[module](.[ext])")
    }

    buildscript {
        repositories {
            mavenCentral()
            maven { url "https://dl.bintray.com/kotlin/kotlin-eap" }
            maven { url "https://dl.bintray.com/kotlin/kotlin-dev" }
            maven { url "https://plugins.gradle.org/m2/" }
            ivy(repo)
        }
        dependencies {
            classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
            classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1'

            classpath "com.gradle.publish:plugin-publish-plugin:0.9.10"
        }
    }

    repositories {
        jcenter()
        mavenCentral()
        mavenLocal()
        maven { url "https://dl.bintray.com/jetbrains/markdown" }
        maven { url "https://dl.bintray.com/kotlin/kotlin-eap" }
        maven { url "https://dl.bintray.com/kotlin/kotlin-dev" }
        maven { url 'https://jitpack.io' }
        maven { url "https://teamcity.jetbrains.com/guestAuth/repository/download/Kotlin_dev_CompilerAllPlugins/$bundled_kotlin_compiler_version/maven" }
        ivy(repo)
        maven { url "https://kotlin.bintray.com/kotlinx" }
        maven { url "https://dl.bintray.com/kotlin/kotlinx" }
        maven { url "https://dl.bintray.com/orangy/maven" } // TODO: remove this repository when kotlinx.cli is available in maven 
    }
}


def bintrayPublication(project, List<String> _publications) {
    configure(project, {
        apply plugin: 'com.jfrog.bintray'

        bintray {
            user = System.getenv('BINTRAY_USER')
            key = System.getenv('BINTRAY_KEY')

            pkg {
                repo = dokka_publication_channel
                name = 'dokka'
                userOrg = 'kotlin'
                desc = 'Dokka, the Kotlin documentation tool'
                vcsUrl = 'https://github.com/kotlin/dokka.git'
                licenses = ['Apache-2.0']
                version {
                    name = dokka_version
                }
            }

            publications = _publications
        }
    })
}

def versions = DependenciesVersionGetter.getVersions(project, bundled_kotlin_compiler_version)

ext.ideaVersion = versions["idea.build.id"]
ext.markdownVersion = versions["markdown.build.id"].replace("%20", " ")

configurations {
    ideaIC
    intellijCore
}

repositories {
    maven { url 'https://www.jetbrains.com/intellij-repository/snapshots' }
    maven { url 'https://www.jetbrains.com/intellij-repository/releases' }
}

dependencies {
    intellijCore "com.jetbrains.intellij.idea:intellij-core:$ideaVersion"
    ideaIC "com.jetbrains.intellij.idea:ideaIC:$ideaVersion"
}

def intellijCoreAnalysis() {
    return zipTree(configurations.intellijCore.singleFile).matching ({
        include("intellij-core-analysis.jar")
    })
}

def ideaRT() {
    return zipTree(project.configurations.ideaIC.singleFile).matching ({
        include("lib/idea_rt.jar")
    })
}

def repoLocation = uri(file("$buildDir/dist-maven"))

configurations {
    kotlin_plugin_full
}

dependencies {
    final String ijVersion = "20" + ideaVersion.take(2) + "." + ideaVersion[2]
    kotlin_plugin_full "teamcity:kotlin-plugin-$bundled_kotlin_compiler_version-IJ$ijVersion-1:$bundled_kotlin_compiler_version@zip"
}

def kotlinPluginDependency() {
    return zipTree(configurations.kotlin_plugin_full.singleFile).matching({
        include("Kotlin/lib/kotlin-plugin.jar")
    })
}


allprojects {

    task publishToDistMaven {
        group "publishing"
        description "Publishes all Maven publications to Maven repository 'distMaven'."
        dependsOn tasks.withType(PublishToMavenRepository).matching {
            it.repository == publishing.repositories.distMaven
        }
    }

    plugins.withType(MavenPublishPlugin) {
        publishing {
            repositories {
                maven {
                    name 'distMaven'
                    url repoLocation
                }
            }
        }

    }
}