-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
155 lines (135 loc) · 5.33 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
plugins {
id "groovy"
id "org.grails.grails-web"
id "org.grails.grails-gsp"
id "org.grails.grails-plugin" version '6.2.1'
id "application"
id 'maven-publish'
id 'signing'
id "io.github.gradle-nexus.publish-plugin" version '2.0.0'
}
group "io.github.gpc"
repositories {
mavenLocal()
mavenCentral()
maven { url "https://repo.grails.org/grails/core/" }
}
dependencies {
implementation("org.grails:grails-core")
implementation("org.grails:grails-logging")
implementation("org.grails:grails-plugin-services")
implementation("org.grails:grails-plugin-url-mappings")
implementation("org.grails:grails-web-boot")
implementation("org.springframework.boot:spring-boot-autoconfigure")
implementation("org.springframework.boot:spring-boot-starter-logging")
console("org.grails:grails-console")
testImplementation("org.spockframework:spock-core")
testImplementation("org.grails:grails-web-testing-support")
testImplementation("org.grails.plugins:geb")
testImplementation platform("org.seleniumhq.selenium:selenium-bom:${seleniumVersion}")
testImplementation("org.seleniumhq.selenium:selenium-api")
testImplementation("org.seleniumhq.selenium:selenium-remote-driver")
testImplementation("org.seleniumhq.selenium:selenium-support")
testImplementation("org.seleniumhq.selenium:selenium-http")
testImplementation("org.seleniumhq.selenium:selenium-chrome-driver")
testImplementation "org.testcontainers:spock:1.20.2"
testImplementation "org.testcontainers:selenium:1.20.2"
implementation "org.grails.plugins:cache"
// https://mvnrepository.com/artifact/com.google.guava/guava
implementation 'com.google.guava:guava:33.3.1-jre'
}
application {
mainClass.set("grails.cache.guava.Application")
}
java {
sourceCompatibility = JavaVersion.toVersion("11")
}
tasks.withType(Test) {
useJUnitPlatform()
systemProperty "geb.env", System.getProperty('geb.env')
systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
}
publishing {
publications {
maven(MavenPublication) {
groupId = project.group
artifactId = project.name
version = project.version
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = 'grails-cache-guava'
description = 'The guava cache provides a simple in memory cache with maximal capacity and TTL.'
url = 'https://github.com/gpc/grails-cache-guava'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'sbglasius'
name = 'Søren Berg Glasius'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/gpc/grails-cache-guava.git'
developerConnection = 'scm:git:https://github.com/gpc/grails-cache-guava.git'
url = 'https://github.com/gpc/grails-cache-guava'
}
}
}
}
}
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
if (System.getenv('SIGNING_KEY_ID')) {
ext["signing.keyId"] = System.getenv('SIGNING_KEY_ID')
ext["signing.password"] = System.getenv('SIGNING_PASSPHRASE')
ext["signing.secretKeyRingFile"] = System.getenv('SIGNING_FILE')
}
afterEvaluate {
signing {
if (System.getenv('SIGN_ARMORED_KEY')) {
String signingKey = System.getenv('SIGN_ARMORED_KEY')
String signingPassword = System.getenv('SIGN_PASSWORD')
useInMemoryPgpKeys(signingKey, signingPassword)
}
required {
isReleaseVersion
}
sign publishing.publications.maven
}
}
tasks.withType(Sign).configureEach {
onlyIf { isReleaseVersion }
}
import io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository
tasks.withType(InitializeNexusStagingRepository).configureEach {
shouldRunAfter(tasks.withType(Sign))
}
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("sonatypeOssStagingProfileIdExternalConfig") ? project.sonatypeOssStagingProfileIdExternalConfig : ''
nexusUrl = uri("https://s01.oss.sonatype.org/service/local/")
snapshotRepositoryUrl = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/")
username = ossUser
password = ossPass
stagingProfileId = ossStagingProfileId
}
}
}
tasks.register('snapshotVersion') {
doLast {
if (isReleaseVersion) {
ant.propertyfile(file: "gradle.properties") {
entry(key: "version", value: "${project.version}-SNAPSHOT")
}
}
}
}