forked from Javacord/Javacord
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjars.gradle
60 lines (50 loc) · 1.38 KB
/
jars.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
subprojects {
apply plugin: 'osgi'
task javadocJar(type: Jar) {
group 'build'
description 'Assembles a jar archive containing the JavaDoc files.'
classifier 'javadoc'
from javadoc
}
task sourcesJar(type: Jar) {
group 'build'
description 'Assembles a jar archive containing the Java source files.'
classifier 'sources'
from sourceSets.main.allJava
}
artifacts {
archives javadocJar, sourcesJar
}
}
project(':javacord-api') {
jar {
manifest {
instruction 'Export-Package', '!org.javacord.*.internal.*', "*;version=$version;-noimport:=true"
}
}
}
project(':javacord-core') {
jar {
manifest {
instruction 'Fragment-Host', "org.javacord.api;bundle-version=\"[$version,$version]\""
instruction 'Import-Package', '!org.javacord.api.*', '*'
instruction 'Export-Package', ''
}
}
}
// remove the main JAR from the archives artifacts
configurations.archives.artifacts.clear()
apply plugin: 'com.github.johnrengelman.shadow'
// remove non-sense task from com.github.johnrengelman.shadow plugin
tasks.remove knows
shadowJar {
classifier 'shaded'
}
artifacts {
archives shadowJar
}
// disable the jar task but do not remove it,
// this is not nicely compatible with composite builds
jar {
enabled false
}