-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
205 lines (183 loc) · 7.04 KB
/
build.gradle
File metadata and controls
205 lines (183 loc) · 7.04 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
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
buildscript {
repositories {
mavenCentral()
gradlePluginPortal()
}
dependencies {
classpath "org.graceframework:grace-gradle-plugin:$graceVersion"
classpath "io.github.gradle-nexus:publish-plugin:2.0.0"
}
}
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")
// Overriding GORM versions in Grace Bom
ext['grace-gorm.version'] = project.gormVersion
ext['grace-gorm-hibernate.version'] = project.gormHibernateVersion
ext['grace-plugin-hibernate.version'] = project.gormHibernateVersion
version = project.projectVersion
group = "org.graceframework.plugins"
apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "groovy"
apply plugin: "java-library"
apply plugin: "org.graceframework.grace-doc"
apply plugin: "org.graceframework.grace-plugin"
apply plugin: "io.github.gradle-nexus.publish-plugin"
apply plugin: "maven-publish"
apply plugin: "signing"
repositories {
mavenCentral()
}
configurations {
documentation
}
dependencies {
api "org.liquibase:liquibase-core", {
exclude group: 'javax.xml.bind', module: 'jaxb-api'
exclude group: 'com.opencsv', module: 'opencsv'
}
api("org.liquibase.ext:liquibase-hibernate5") {
exclude group: 'org.hibernate', module: 'hibernate-core'
exclude group: 'org.hibernate', module: 'hibernate-entitymanager'
exclude group: 'org.hibernate', module: 'hibernate-envers'
exclude group: 'org.liquibase', module: 'liquibase-core'
exclude group: 'org.liquibase', module: 'liquibase-commercial'
exclude group: 'org.liquibase', module: 'liquibase-test-harness'
exclude group: 'com.h2database', module: 'h2'
}
compileOnly("org.graceframework:grace-shell") {
exclude group: 'org.slf4j', module: 'slf4j-simple'
}
api "org.apache.groovy:groovy-sql"
compileOnly "org.graceframework:grace-boot"
compileOnly "org.graceframework:grace-cli"
compileOnly 'jakarta.servlet:jakarta.servlet-api'
implementation "org.graceframework:grace-datastore-gorm"
implementation "org.graceframework.plugins:hibernate"
testImplementation "org.graceframework:grace-shell"
testImplementation "org.graceframework.plugins:hibernate"
testImplementation "org.graceframework:grace-test-support"
testImplementation "org.mockito:mockito-core"
testImplementation "com.h2database:h2"
documentation "com.github.javaparser:javaparser-core:$javaParserCoreVersion"
documentation "org.apache.groovy:groovy"
documentation "org.apache.groovy:groovy-ant"
documentation "org.apache.groovy:groovy-templates"
documentation "org.apache.groovy:groovy-xml"
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
withJavadocJar()
withSourcesJar()
}
jar {
enabled = true
archiveClassifier.set('plugin')
includeEmptyDirs = false
exclude 'testapp/*.class', 'databasemigration/*.class'
}
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 Database Migration Plugin - ${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
}
docs {
dependsOn groovydoc
sourceDir = project.file('src/docs')
}
publishing {
publications {
maven(MavenPublication) {
groupId = project.group
artifactId = project.name
version = project.version
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
from components.java
afterEvaluate {
artifact source: "${project.sourceSets.main.groovy.classesDirectory.get()}/META-INF/grails-plugin.xml",
classifier: "plugin",
extension: 'xml'
}
pom {
name = "Grace Database Migration Plugin"
description = "Grace Database Migration"
url = 'https://github.com/graceframework/grace-database-migration'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'rainboyan'
name = 'Michael Yan'
email = 'rain@rainboyan.com'
}
}
scm {
connection = 'scm:git:git://github.com/graceframework/grace-database-migration.git'
developerConnection = 'scm:git:ssh://github.com:graceframework/grace-database-migration.git'
url = 'https://github.com/graceframework/grace-database-migration'
}
}
}
}
}
nexusPublishing {
packageGroup = 'org.graceframework.plugins'
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
}
}
}
afterEvaluate {
signing {
required = isReleaseVersion && gradle.taskGraph.hasTask("publish")
sign publishing.publications.maven
}
}