-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.gradle
54 lines (43 loc) · 1.08 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
apply plugin: "java"
apply plugin: "maven"
group = "com.github.jitpack"
version = 1.0
sourceCompatibility = 1.8 // java 8
targetCompatibility = 1.8
repositories {
mavenCentral()
}
sourceSets {
api
impl
}
sourceSets.all { set ->
def jarTask = task("${set.name}Jar", type: Jar) {
baseName = "$set.name"
from set.output
}
artifacts {
archives jarTask
}
}
dependencies {
apiCompile 'commons-codec:commons-codec:1.5'
implCompile sourceSets.api.output
implCompile 'commons-lang:commons-lang:2.6'
testCompile 'junit:junit:4.9'
testCompile sourceSets.api.output
testCompile sourceSets.impl.output
runtime configurations.apiRuntime
runtime configurations.implRuntime
}
jar {
from sourceSets.api.output
from sourceSets.impl.output
}
// this step is necessary when installing both jars in the local maven repository
install {
repositories.mavenInstaller {
addFilter('api') { artifact, file -> artifact.name.endsWith('api') }
addFilter('impl') { artifact, file -> artifact.name.endsWith('impl') }
}
}