forked from grails/gorm-graphql
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
146 lines (125 loc) · 4.21 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
buildscript {
repositories {
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "org.grails:grails-docs:${project.ext.properties.grailsDocsVersion ?: grailsVersion}"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.bmuschko:gradle-nexus-plugin:2.3.1'
classpath 'io.github.groovylang.groovydoc:groovydoc-gradle-plugin:1.0.1'
}
}
//plugins {
// id 'com.gradle.build-scan' version '2.0.2'
//}
repositories {
maven { url "https://repo.grails.org/grails/core" }
}
String branchedVersion
if(project.projectVersion.contains("BUILD-SNAPSHOT")) {
String branch = System.getenv("BRANCH")?.replaceAll("/", "_")
if(branch) {
branchedVersion = "${project.projectVersion - ".BUILD-SNAPSHOT"}.${branch}.BUILD-SNAPSHOT"
println "Publishing as SNAPSHOT branch version '$branchedVersion'"
}
}
version branchedVersion ?: project.projectVersion
ext {
commonBuild = 'https://raw.githubusercontent.com/grails/grails-common-build/9531dd5e6d774b86e2d8220aff3bcec3add43320'
}
subprojects {
version branchedVersion ?: project.projectVersion
ext {
userOrg = "grails"
isGrailsPlugin = name.startsWith('grails-plugin')
isBuildSnapshot = version.toString().endsWith("-SNAPSHOT")
}
repositories {
maven { url "https://repo.grails.org/grails/core" }
}
if(project.name.startsWith("examples-")) {
if(project.name.startsWith("examples-grails-")) {
apply plugin:"org.grails.grails-web"
}
tasks.withType(Test) {
testLogging {
events "failed"
exceptionFormat "full"
}
}
return
}
if(isGrailsPlugin) {
group "org.grails.plugins"
}
else {
group "org.grails"
}
if(project.name.endsWith('docs')) {
apply from:"${commonBuild}/common-docs.gradle"
return
}
if (isGrailsPlugin) {
apply plugin:"org.grails.grails-plugin"
}
else {
apply from:"${commonBuild}/common-project.gradle"
}
apply from:"${commonBuild}/common-publishing.gradle"
publishing {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/jamesdh/gorm-graphql")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}
publications {
gpr(MavenPublication) {
if(isGrailsPlugin) {
artifactId( project.name - 'grails-plugin-' )
}
else if(project.name.contains('/')) {
artifactId( project.name.substring(project.name.indexOf('/') + 1) )
}
from components.java
afterEvaluate {
artifact source: sourcesJar, classifier: "sources"
artifact source: javadocJar, classifier: "javadoc"
}
if(isGrailsPlugin) {
artifact source:"${project.buildDir}/classes/groovy/main/META-INF/grails-plugin.xml",
classifier:"plugin",
extension:'xml'
}
pom.withXml {
def xml = asNode()
xml.children().last() + pomInfo
// dependency management shouldn't be included
def n = xml.get("dependencyManagement")
if (n)
xml.remove(n)
}
}
}
}
dependencies {
testCompile "org.codehaus.groovy:groovy-test:$groovyVersion"
}
tasks.withType(GroovyCompile) {
configure(groovyOptions) {
forkOptions.jvmArgs = ['-Xmx1024m']
}
}
tasks.withType(Test) {
testLogging {
events "failed"
exceptionFormat "full"
showStandardStreams true
}
}
}