-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.gradle
214 lines (185 loc) · 6.06 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
buildscript {
repositories {
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
classpath "org.asciidoctor:asciidoctor-gradle-jvm:4.0.1"
}
}
plugins {
id 'maven-publish'
id 'idea'
id 'eclipse'
id 'signing'
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0'
}
version project.projectVersion
group = 'org.grails.plugins'
apply plugin: "java-library"
apply plugin: "org.grails.grails-plugin"
apply plugin: "org.grails.grails-gsp"
apply plugin: "org.asciidoctor.jvm.convert"
repositories {
mavenCentral()
maven { url "https://repo.grails.org/grails/core" }
}
configurations {
documentation
}
dependencies {
compileOnly 'javax.servlet:javax.servlet-api:4.0.1'
compileOnly 'org.grails:grails-dependencies'
compileOnly "org.grails:grails-plugin-services"
api 'com.github.scribejava:scribejava-apis:8.3.3'
api 'org.grails.plugins:spring-security-core:6.1.1'
console "org.grails:grails-console"
profile "org.grails.profiles:web-plugin"
testImplementation "org.springframework.boot:spring-boot-autoconfigure"
testImplementation "org.springframework.boot:spring-boot-starter-actuator"
testImplementation "org.springframework.boot:spring-boot-starter-tomcat"
testImplementation "cglib:cglib-nodep:3.3.0"
testImplementation "org.grails:grails-gorm-testing-support"
testImplementation "org.grails:grails-web-testing-support"
documentation "com.github.javaparser:javaparser-core:3.25.8"
}
ext."signing.keyId" = project.hasProperty("signing.keyId") ? project.getProperty('signing.keyId') : System.getenv('SIGNING_KEY')
ext."signing.secretKeyRingFile" = project.hasProperty("signing.secretKeyRingFile") ? project.getProperty('signing.secretKeyRingFile') : "${System.properties['user.home']}${File.separator}.gnupg${File.separator}secring.gpg"
ext."signing.password" = project.hasProperty("signing.password") ? project.getProperty('signing.password') : System.getenv('SIGNING_PASSPHRASE')
ext.isSnapshot = project.projectVersion.endsWith('-SNAPSHOT')
ext.isReleaseVersion = !isSnapshot
publishing {
if (isSnapshot) {
repositories {
maven {
credentials {
def u = System.getenv("ARTIFACTORY_USERNAME") ?: project.hasProperty("artifactoryPublishUsername") ? project.artifactoryPublishUsername : ''
def p = System.getenv("ARTIFACTORY_PASSWORD") ?: project.hasProperty("artifactoryPublishPassword") ? project.artifactoryPublishPassword : ''
username = u
password = p
}
url "https://repo.grails.org/grails/plugins3-snapshots-local"
}
}
}
publications {
maven(MavenPublication) {
groupId = project.group
artifactId = 'spring-security-oauth2'
version = project.version
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = 'Spring Security Oauth2 Plugin'
description = 'This plugin provides the capability to authenticate via oauth and depends on grails-spring-security-core.'
url = 'https://github.com/grails/grails-spring-security-oauth2'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'MatrixCrawler'
name = 'Johannes Brunswicker'
email = ''
}
developer {
id = 'aitmanas'
name = 'aitmanas'
email = ''
}
developer {
id = 'rvanderwerf'
name = 'Ryan Vanderwerf'
email = ''
}
developer {
id = 'puneetbehl'
name = 'Puneet Behl'
email = ''
}
}
scm {
connection = 'scm:git:https://github.com/grails/grails-spring-security-oauth2.git'
developerConnection = 'scm:git:https://github.com/grails/grails-spring-security-oauth2.git'
url = 'https://github.com/grails/grails-spring-security-oauth2/tree/2.0.x'
}
}
}
}
}
signing {
sign publishing.publications.maven
}
tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}
if (isReleaseVersion) {
apply plugin: 'maven-publish'
apply plugin: "io.github.gradle-nexus.publish-plugin"
nexusPublishing {
repositories {
sonatype {
def ossUser = System.getenv("SONATYPE_USERNAME") ?: project.hasProperty("sonatypeOssUsername") ? project.sonatypeOssUsername : ''
def ossPass = System.getenv("SONATYPE_PASSWORD") ?: project.hasProperty("sonatypeOssPassword") ? project.sonatypeOssPassword : ''
def ossStagingProfileId = System.getenv("SONATYPE_STAGING_PROFILE_ID") ?: project.hasProperty("sonatypeOssStagingProfileId") ? project.sonatypeOssStagingProfileId : ''
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
username = ossUser
password = ossPass
stagingProfileId = ossStagingProfileId
}
}
}
}
tasks.withType(Test) {
useJUnitPlatform()
}
def asciidoctorAttributes = [
projectVersion : projectVersion,
copyright : 'Apache License, Version 2.0',
docinfo1 : 'true',
doctype : 'book',
encoding : 'utf-8',
'front-cover-image' : 'image:cover.png[Front Cover,800,600]',
icons : 'font',
id : project.name + ':' + project.version,
idprefix : '',
idseparator : '-',
lang : 'en',
linkattrs : true,
numbered : '',
producer : 'Asciidoctor',
revnumber : project.version,
setanchors : true,
'source-highlighter' : 'prettify',
toc : 'left',
toc2 : '',
toclevels : '2'
]
asciidoctor {
attributes asciidoctorAttributes
baseDirFollowsSourceDir()
outputDir new File(buildDir, 'docs')
sourceDir = file('src/docs')
sources {
include 'index.adoc'
}
}
tasks.register("docs") {
description = "Generates documentation"
group = "documentation"
dependsOn(tasks.named("asciidoctor"))
mustRunAfter("build")
doLast {
new File(buildDir, 'docs/ghpages.html') << file('src/docs/index.tmpl').text.replaceAll('@VERSION@', project.version)
}
}
configure([groovydoc]) {
classpath += configurations.documentation
}
tasks.named("build").configure {
mustRunAfter("docs")
}