-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
81 lines (71 loc) · 1.73 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
apply plugin: 'java'
apply plugin: 'maven'
group = 'com.github.jitpack'
sourceCompatibility = 1.8 // java 8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
// See https://docs.gradle.org/current/userguide/dependency_management_attribute_based_matching.html
if (project.hasProperty('objects')) {
def usageAttr = Attribute.of("org.gradle.usage", Usage)
// Gradle 4+
configurations {
apiConf {
attributes {
attribute(usageAttr, project.objects.named(Usage, "java-api"))
}
}
runtimeConf {
attributes {
attribute(usageAttr, project.objects.named(Usage, "java-runtime"))
}
}
}
} else {
// Gradle 3
def usageAttr = Attribute.of('usage', String)
configurations {
apiConf {
attributes {
attribute(usageAttr, "java-api")
}
}
runtimeConf {
attributes {
attribute(usageAttr, "java-runtime")
}
}
}
}
dependencies {
compile 'com.google.guava:guava:18.0'
apiConf 'commons-httpclient:commons-httpclient:3.1'
runtimeConf 'org.apache.commons:commons-lang3:3.8.1'
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
artifacts {
archives sourcesJar
archives javadocJar
}
// To specify a license in the pom:
install {
repositories.mavenInstaller {
pom.project {
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}
}
}
}