forked from TheElectronWill/night-config
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
122 lines (106 loc) · 2.56 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
configure(subprojects.findAll {it.name != "examples"}) {
group projectGroup
version projectVersion
description "$projectDescription - $name module"
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'maven'
apply plugin: 'java'
sourceCompatibility = javaVersion
archivesBaseName = "nightconfig-$name"
repositories {
mavenCentral()
}
dependencies {
testCompile "org.junit.jupiter:junit-jupiter-api:$junitVersion"
testRuntime "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
}
test {
useJUnitPlatform()
}
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier = 'javadoc'
from javadoc.destinationDir
}
task sourcesJar(type: Jar) {
archiveClassifier = 'sources'
from sourceSets.main.java.srcDirs
}
artifacts {
archives sourcesJar
archives javadocJar
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = "NightConfig ${project.name}".toString()
description = project.description
url = projectUrl
developers {
developer {
id = 'TheElectronWill'
url = 'https://github.com/TheElectronWill'
}
}
licenses {
license {
name = projectLicense
url = projectLicenseUrl
}
}
scm {
url = projectWebScm
connection = projectScm
developerConnection = projectScm
}
}
}
}
repositories {
maven {
credentials {
username ossrhUser
password ossrhPassword
}
url project.version.endsWith('SNAPSHOT') ? publishSnapshotUrl : publishReleaseUrl
}
}
}
signing {
sign publishing.publications.mavenJava
}
}
configure(subprojects.findAll {!it.name.contains("core") && it.name != "examples"}) {
task fatJar(type: Jar) {
archiveBaseName = archivesBaseName + '-fat'
from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
with jar
}
dependencies {
if (project.name.contains("android")) {
compile project(':core_android')
testCompile project(path: ':core_android', configuration: 'tests')
} else {
compile project(':core')
testCompile project(path: ':core', configuration: 'tests')
}
}
}
configure(subprojects.findAll {it.name.contains("core")}) {
/* The purpose of this code is allow the other modules
to use the core test classes for their tests. */
task testJar(type: Jar, dependsOn: testClasses) {
baseName = "test-${project.archivesBaseName}"
from sourceSets.test.output
}
configurations {
tests
}
artifacts {
tests testJar
}
}