summaryrefslogtreecommitdiff
path: root/build.gradle
blob: 3201d57733a107883e2fa644bbe81e99d25e363f (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
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
    }
}

ext.projectVersion = projectVersion
if (System.getenv('BINTRAY_USER') == null) {
    ext.projectVersion = ext.projectVersion + '-SNAPSHOT'
}

allprojects {
    group 'org.jetbrains'
    version rootProject.ext.projectVersion
}

subprojects {
    apply plugin: 'java'
    apply plugin: 'maven-publish'
    apply plugin: 'com.jfrog.bintray'

    repositories {
        mavenCentral()
    }
}

project(':java5').archivesBaseName = 'annotations-java5'
project(':java8').archivesBaseName = 'annotations'

configure([project(':java5'), project(':java8')]) {
    dependencies {
        compile project(':common')
    }

    task mainJar(type: Jar) {
        from sourceSets.main.output
        from project(':common').sourceSets.main.output
    }

    task sourceJar(type: Jar) {
        from sourceSets.main.java
        from project(':common').sourceSets.main.java
        baseName = archivesBaseName + '-sources'
    }

    javadoc {
        source = [sourceSets.main.java, project(':common').sourceSets.main.java]
    }

    task javadocJar(type: Jar) {
        from javadoc
    }

    artifacts {
        archives mainJar, sourceJar
    }

    publishing {
        publications {
            mavenJava(MavenPublication) {
                artifactId archivesBaseName
                artifact mainJar
                artifact sourceJar {
                    classifier 'sources'
                }
                artifact javadocJar {
                    classifier 'javadoc'
                }
                pom.withXml {
                    asNode().children().last() + {
                        resolveStrategy = DELEGATE_FIRST
                        name 'JetBrains Java Annotations'
                        description 'A set of annotations used for code inspection support and code documentation.'
                        url 'https://github.com/JetBrains/java-annotations'
                        scm {
                            url 'https://github.com/JetBrains/java-annotations'
                            connection 'scm:git:git://github.com/JetBrains/java-annotations.git'
                            developerConnection 'scm:git:ssh://github.com:JetBrains/java-annotations.git'
                        }
                        licenses {
                            license {
                                name 'The Apache Software License, Version 2.0'
                                url 'http://www.apache.org/license/LICENSE-2.0.txt'
                                distribution 'repo'
                            }
                        }
                        developers {
                            developer {
                                id 'JetBrains'
                                name 'JetBrains Team'
                                organization 'JetBrains'
                                organizationUrl 'https://www.jetbrains.com'
                            }
                        }
                    }
                }

            }
        }
    }
    if (System.getenv('BINTRAY_USER') != null) {
        bintray {
            user = System.getenv('BINTRAY_USER')
            key = System.getenv('BINTRAY_KEY')
            publish = true
            publications = ['mavenJava']
            pkg {
                userOrg = 'jetbrains'
                repo = 'intellij-redist'
                name = 'org.jetbrains:' + archivesBaseName
                version {
                    name = rootProject.ext.projectVersion
                }
            }
        }
    }

}