-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
116 lines (104 loc) · 3.49 KB
/
build.gradle
File metadata and controls
116 lines (104 loc) · 3.49 KB
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
plugins {
id 'java-library'
id 'groovy'
id 'maven-publish'
id 'signing'
id 'eclipse'
id 'idea'
alias libs.plugins.grace.doc
alias libs.plugins.gradle.nexus.publish
alias libs.plugins.gradle.test.retry
}
ext.'signing.keyId' = rootProject.hasProperty('signing.keyId') ? rootProject.getProperty('signing.keyId') : System.getenv('SIGNING_KEY')
ext.'signing.password' = rootProject.hasProperty('signing.password') ? rootProject.getProperty('signing.password') : System.getenv('SIGNING_PASSPHRASE')
ext.'signing.secretKeyRingFile' = rootProject.hasProperty('signing.secretKeyRingFile') ? rootProject.getProperty('signing.secretKeyRingFile') : "${System.properties['user.home']}${File.separator}.gnupg${File.separator}secring.gpg"
ext.isReleaseVersion = !projectVersion.endsWith('SNAPSHOT')
version = project.projectVersion
group = 'org.graceframework.async'
repositories {
mavenCentral()
if (project.projectVersion.endsWith('-SNAPSHOT')) {
maven {
name = 'Maven Central Portal Snapshots'
url = 'https://central.sonatype.com/repository/maven-snapshots/'
content {
includeGroupAndSubgroups 'org.graceframework'
}
mavenContent {
snapshotsOnly()
}
}
}
}
configurations {
documentation
}
dependencies {
documentation libs.javaparser
documentation libs.groovy.core
}
tasks.withType(Test) {
useJUnitPlatform()
testLogging {
showStandardStreams = true
exceptionFormat = 'full'
}
configure {
retry {
maxRetries = 2
maxFailures = 20
failOnPassedAfterRetry = true
}
}
}
def cleanTask = project.tasks.findByName('clean')
if (cleanTask == null) {
task clean(type: Delete) {
delete(buildDir)
}
}
else {
cleanTask.doLast {
ant.delete(dir: 'build/docs')
}
}
tasks.withType(Groovydoc) {
group = 'Documentation'
docTitle = "Grace Async Framework - ${project.version}"
destinationDir = project.file('build/docs/manual/api')
def files = []
project.rootProject.subprojects
.findAll { !it.name != 'docs' && !it.name.startsWith('examples') }
.each { subproject ->
if(subproject.file('src/main/groovy').exists()) {
files += subproject.files('src/main/groovy')
}
if(subproject.file('src/main/java').exists()) {
files += subproject.files('src/main/java')
}
}
if (project.file('src/main/groovy').exists()) {
files += project.files('src/main/groovy')
}
source = files
classpath += configurations.documentation
}
publishGuide {
dependsOn groovydoc
sourceDir = project.file('src/main/docs')
}
tasks.register('docs') { task ->
task.dependsOn groovydoc, publishGuide
}
nexusPublishing {
repositories {
sonatype {
def mavenUser = System.getenv('MAVEN_CENTRAL_USER') ?: project.hasProperty('mavenCentralUsername') ? project.mavenCentralUsername : ''
def mavenPass = System.getenv('MAVEN_CENTRAL_PASSWORD') ?: project.hasProperty('mavenCentralPassword') ? project.mavenCentralPassword : ''
nexusUrl = uri('https://ossrh-staging-api.central.sonatype.com/service/local/')
snapshotRepositoryUrl = uri('https://central.sonatype.com/repository/maven-snapshots/')
username = mavenUser
password = mavenPass
}
}
}