File: build.gradle

package info (click to toggle)
intellij-annotations 23.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid, trixie
  • size: 316 kB
  • sloc: java: 402; sh: 128; makefile: 15
file content (127 lines) | stat: -rw-r--r-- 4,246 bytes parent folder | download
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
/*
 * Copyright 2000-2021 JetBrains s.r.o.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

buildscript {
    repositories {
        maven { url "https://packages.jetbrains.team/maven/p/jcs/maven" }
    }
}

ext.projectVersion = projectVersion
ext.publishingUser = System.getenv('PUBLISHING_USER')
ext.publishingPassword = System.getenv('PUBLISHING_PASSWORD')
if (ext.publishingPassword == null) {
    ext.projectVersion = ext.projectVersion + '-SNAPSHOT'
}
println "##teamcity[setParameter name='java.annotations.version' value='$projectVersion']"

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

subprojects {
    apply plugin: 'java'
    apply plugin: 'maven-publish'
    apply plugin: 'signing'

    repositories {
        mavenCentral()
    }
}

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

configure([project(':java8')]) {
    dependencies {
        compile project(':module-info')
    }
    
    task mainJar(type: Jar) {
        into ("META-INF/versions/9", {
            from (project(':module-info').sourceSets.main.output, {
                // Skip extra files from common sources compiled with Java 9 target
                include("module-info.class")
            })
        })
        manifest.attributes("Multi-Release": true)
        duplicatesStrategy = DuplicatesStrategy.FAIL
    }

    task sourceJar(type: Jar) {
        into ("META-INF/versions/9", {
            from project(':module-info').sourceSets.main.java
        })
        duplicatesStrategy = DuplicatesStrategy.FAIL
        baseName = archivesBaseName + '-sources'
    }

    task javadocJar(type: Jar) {
        duplicatesStrategy = DuplicatesStrategy.FAIL
        from javadoc
    }

    artifacts {
        archives mainJar, sourceJar
    }

    publishing {
        publications {
            mavenJava(MavenPublication) {
                group rootProject.group
                version rootProject.ext.projectVersion
                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 'https://www.apache.org/licenses/LICENSE-2.0.txt'
                                distribution 'repo'
                            }
                        }
                        developers {
                            developer {
                                id 'JetBrains'
                                name 'JetBrains Team'
                                organization 'JetBrains'
                                organizationUrl 'https://www.jetbrains.com'
                            }
                        }
                    }
                }

            }
        }
    }

}