-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
143 lines (124 loc) · 4.75 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
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsGradlePluginVersion"
}
}
plugins {
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
id 'maven-publish'
id 'signing'
}
group "io.github.gpc"
apply plugin: "org.grails.grails-plugin"
repositories {
mavenCentral()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
implementation "org.springframework.boot:spring-boot-starter-logging"
implementation "org.springframework.boot:spring-boot-starter-validation"
implementation "org.springframework.boot:spring-boot-autoconfigure"
implementation "org.grails:grails-core"
compileOnly "org.grails:grails-plugin-domain-class"
implementation 'com.googlecode.libphonenumber:libphonenumber:8.13.29'
profile "org.grails.profiles:plugin"
testImplementation "org.grails:grails-testing-support"
testImplementation "org.mockito:mockito-core"
testImplementation 'org.grails:grails-plugin-validation'
}
bootRun {
ignoreExitValue true
jvmArgs(
'-Dspring.output.ansi.enabled=always',
'-noverify',
'-XX:TieredStopAtLevel=1',
'-Xmx1024m')
sourceResources sourceSets.main
String springProfilesActive = 'spring.profiles.active'
systemProperty springProfilesActive, System.getProperty(springProfilesActive)
}
tasks.withType(GroovyCompile).configureEach {
configure(groovyOptions) {
forkOptions.jvmArgs = ['-Xmx1024m']
}
}
tasks.withType(Test).configureEach {
useJUnitPlatform()
}
// enable if you wish to package this plugin as a standalone application
bootJar.enabled = false
publishing {
publications {
maven(MavenPublication) {
groupId = project.group
artifactId = 'phone-number-constraint'
version = project.version
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = 'phone-number-constraint'
description = "This plugin establishes a 'phoneNumber' constraint for validateable objects."
url = 'https://github.com/gpc/grails-phone-number-constraint'
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-phone-number-constraint.git'
developerConnection = 'scm:git:ssh://github.com:gpc/grails-phone-number-constraint.git'
url = 'https://github.com/gpc/grails-phone-number-constraint/tree/main'
}
}
}
}
}
ext."signing.keyId" = project.findProperty('signing.keyId') ?: System.getenv('SIGNING_KEY_ID')
ext."signing.password" = project.findProperty('signing.password') ?: System.getenv('SIGNING_PASSPHRASE')
ext."signing.secretKeyRingFile" = project.findProperty('signing.secretKeyRingFile') ?: (System.getenv('SIGNING_PASSPHRASE') ?: "${System.getProperty('user.home')}/.gnupg/secring.gpg")
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
afterEvaluate {
signing {
required { isReleaseVersion }
sign publishing.publications.maven
}
}
tasks.withType(Sign).configureEach {
onlyIf { isReleaseVersion }
}
nexusPublishing {
repositories {
sonatype {
def ossUser = System.getenv('SONATYPE_USERNAME') ?: project.findProperty('sonatypeOss2Username') ?: ''
def ossPass = System.getenv('SONATYPE_PASSWORD') ?: project.findProperty("sonatypeOss2Password") ?: ''
def ossStagingProfileId = System.getenv('SONATYPE_STAGING_PROFILE_ID') ?: project.findProperty("sonatypeOssStagingProfileId") ?: ''
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 (!project.version.endsWith('-SNAPSHOT')) {
ant.propertyfile(file: "gradle.properties") {
entry(key: "version", value: "${project.version}-SNAPSHOT")
}
}
}
}