-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
89 lines (79 loc) · 2.86 KB
/
build.gradle
File metadata and controls
89 lines (79 loc) · 2.86 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
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
}
ext."signing.keyId" = project.hasProperty("signing.keyId") ? project.getProperty('signing.keyId') : System.getenv('SIGNING_KEY')
ext."signing.password" = project.hasProperty("signing.password") ? project.getProperty('signing.password') : System.getenv('SIGNING_PASSPHRASE')
ext."signing.secretKeyRingFile" = project.hasProperty("signing.secretKeyRingFile") ? project.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"
repositories {
mavenCentral()
}
configurations {
documentation
}
dependencies {
documentation libs.javaparser
documentation libs.groovy.core
}
def cleanTask = project.tasks.findByName('clean')
if (cleanTask == null) {
def buildDir = project.layout.buildDirectory
tasks.register('clean', Delete) {
it.delete(buildDir)
}
}
else {
def docsDir = project.layout.buildDirectory.dir('docs')
cleanTask.doLast {
((Delete) it).delete(docsDir)
}
}
tasks.withType(Groovydoc) {
group = 'Documentation'
docTitle = "Grace Data - ${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/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
}
}
}