forked from npryce/maybe-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
73 lines (62 loc) · 1.59 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
plugins {
id "java-library"
id "maven-publish"
}
ext {
buildNumber = System.getenv("BUILD_NUMBER")
}
group = "com.youdevise"
if (buildNumber) version = "1.0.$buildNumber"
tasks.withType(Jar).all {
manifest {
attributes(
'Implementation-Title': project.name,
'Implementation-Version': project.version,
'Implementation-Vendor': 'TIM Group Ltd'
)
}
}
tasks.withType(JavaCompile).all {
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
options.encoding = "UTF-8"
options.deprecation = true
options.compilerArgs << "-parameters"
options.compilerArgs << "-Xlint:unchecked"
}
repositories {
mavenCentral()
}
dependencies {
api "com.google.guava:guava:13.0.1"
testImplementation "junit:junit:4.12"
testImplementation "org.hamcrest:hamcrest-library:1.3"
}
task sourcesJar(type: Jar, dependsOn:classes) {
archiveClassifier = 'sources'
from sourceSets.main.allSource
}
assemble.dependsOn(sourcesJar)
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
assemble.dependsOn(javadocJar)
publishing {
repositories {
maven {
url = "$repoUrl/repositories/yd-release-candidates"
credentials {
username = project.repoUsername
password = project.repoPassword
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
artifact(sourcesJar)
artifact(javadocJar)
}
}
}