forked from JetBrains/java-annotations
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
150 lines (133 loc) · 4.7 KB
/
build.gradle
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
import jetbrains.sign.GpgSignSignatoryProvider
/*
* 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" }
}
dependencies {
classpath 'com.jetbrains:jet-sign:38'
}
}
plugins {
id "io.github.gradle-nexus.publish-plugin" version "1.1.0"
}
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
}
nexusPublishing {
repositories {
sonatype {
username = rootProject.ext.publishingUser
password = rootProject.ext.publishingPassword
}
}
}
subprojects {
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'signing'
repositories {
mavenCentral()
}
}
project(':java5').archivesBaseName = 'annotations-java5'
project(':java8').archivesBaseName = 'annotations'
configure([project(':java5'), 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'
}
}
}
}
}
}
}
signing {
sign publishing.publications
signatories = new GpgSignSignatoryProvider()
}
}