-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathbuild.gradle
61 lines (51 loc) · 1.74 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
subprojects {
apply plugin: 'java'
apply plugin: 'maven-publish'
group 'me.bristermitten'
version '0.0.33'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
task javadocJar(type: Jar, dependsOn: javadoc) {
archiveClassifier.set('javadoc')
from javadoc.destinationDir
}
javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
publishing {
repositories {
maven {
def releasesRepoUrl = "https://repo.bristermitten.me/repository/maven-releases"
def snapshotsRepoUrl = "https://repo.bristermitten.me/repository/maven-snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username project.hasProperty('mavenUser') ? mavenUser : System.getenv('MAVEN_USER')
password project.hasProperty('mavenPassword') ? mavenPassword : System.getenv('MAVEN_PASSWORD')
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter:5.4.2'
}
test {
useJUnitPlatform()
}
}
task publishAllToMaven {
dependsOn subprojects.find { it.name == 'common-lib' }.tasks.getByName("publish")
dependsOn subprojects.find { it.name == 'pdm' }.tasks.getByName("publish")
}