-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
166 lines (147 loc) · 5.5 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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
/*
* Copyright 2014-2019 the original author or authors.
*
* 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
*
* http://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 {
ext.kotlin_version = '1.3.61'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'ru.vyarus:gradle-animalsniffer-plugin:1.5.0'
}
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
}
group = 'io.timeandspace'
version = '1.5-SNAPSHOT'
}
subprojects {
apply plugin: 'java-library'
apply plugin: 'kotlin'
apply plugin: 'signing'
apply plugin: 'maven'
apply plugin: 'maven-publish'
if (project.name != 'gradle-plugin') {
apply plugin: 'ru.vyarus.animalsniffer'
}
dependencies {
implementation 'org.jetbrains:annotations-java5:17.0.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.1.0'
testImplementation 'org.reflections:reflections:0.9.11'
testImplementation 'com.google.guava:guava:27.1-jre'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.1.0'
// For Animal Sniffer
if (project.name != 'gradle-plugin') {
signature 'org.codehaus.mojo.signature:java18:1.0@signature'
}
}
compileJava {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
compileKotlin {
kotlinOptions {
jvmTarget = '1.8'
}
}
// https://docs.gradle.org/5.0-rc-1/userguide/java_library_plugin.html#sec:java_library_known_issues_compat
configurations {
apiElements {
outgoing.variants.getByName('classes').artifact(
file: compileKotlin.destinationDir,
type: ArtifactTypeDefinition.JVM_CLASS_DIRECTORY,
builtBy: compileKotlin)
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier 'sources'
from sourceSets.main.allSource
}
def generateJavadoc = project.name != 'cli'
task javadocJar(type: Jar) {
classifier 'javadoc'
// The javadoc artifact still should be present by the Maven Central repo rules, just making
// it empty.
if (generateJavadoc)
from javadoc
}
publishing {
publications {
mavenJava(MavenPublication) {
artifactId = "jpsg-$project.name"
from components.java
artifact sourcesJar
artifact javadocJar
pom {
afterEvaluate {
name = "JPSG $project.description"
description = "Java Primitive Specializations Generator $project.description"
}
url = 'https://github.com/TimeAndSpaceIO/java-primitive-specializations-generator'
inceptionYear = '2013'
licenses {
license {
name = 'The Apache Software License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution = 'repo'
}
}
scm {
url = 'https://github.com/TimeAndSpaceIO/java-primitive-specializations-generator'
connection = 'scm:git:git://github.com/TimeAndSpaceIO/java-primitive-specializations-generator.git'
developerConnection = 'scm:git:ssh://github.com/TimeAndSpaceIO/java-primitive-specializations-generator.git'
}
developers {
developer {
id = 'leventov'
name = 'Roman Leventov'
email = 'leventov.ru@gmail.com'
url = 'https://timeandspace.io'
}
}
issueManagement {
system = 'GitHub'
url = 'https://github.com/TimeAndSpaceIO/java-primitive-specializations-generator/issues'
}
}
}
}
ext {
if (!project.hasProperty('sonatypeUrl'))
sonatypeUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
if (!project.hasProperty('sonatypeUsername')) sonatypeUsername = ''
if (!project.hasProperty('sonatypePassword')) sonatypePassword = ''
}
repositories {
maven {
url = sonatypeUrl
credentials {
username = sonatypeUsername
password = sonatypePassword
}
}
}
}
ext.isReleaseVersion = !version.endsWith('SNAPSHOT')
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask('publish') }
sign publishing.publications.mavenJava
}
}