-
Notifications
You must be signed in to change notification settings - Fork 26
/
build.gradle
191 lines (160 loc) · 5.28 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
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven {
url "https://xbib.org/repository"
}
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'org.xbib.gradle.plugin:gradle-plugin-jflex:3.0.2'
classpath "io.github.gradle-nexus:publish-plugin:1.3.0"
}
}
apply plugin: 'java'
apply plugin: 'java-library'
apply plugin: 'groovy'
apply plugin: 'maven-publish'
apply plugin: 'idea'
apply plugin: 'signing'
apply plugin: 'org.xbib.gradle.plugin.jflex'
ext {
isBuildSnapshot = version.endsWith('-SNAPSHOT')
isReleaseVersion = !isBuildSnapshot
}
group = 'com.bertramlabs.plugins'
version = '0.9.7'
ext.isReleaseVersion = !version.endsWith("SNAPSHOT")
sourceCompatibility = "1.8"
targetCompatibility = "1.8"
java {
sourceCompatibility = JavaVersion.toVersion("8")
targetCompatibility = JavaVersion.toVersion("8")
withSourcesJar()
withJavadocJar()
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
api "commons-logging:commons-logging:1.3.1"
api 'com.fasterxml.jackson.core:jackson-databind:2.18.1'
api "commons-logging:commons-logging:1.3.3"
api 'com.fasterxml.jackson.core:jackson-databind:2.18.1'
api 'com.fasterxml.jackson.core:jackson-annotations:2.17.1'
api 'com.fasterxml.jackson.core:jackson-core:2.18.1'
api "org.slf4j:slf4j-api:2.0.16"
api 'org.apache.httpcomponents:httpclient:4.5.14'
api 'org.apache.httpcomponents:httpcore:4.4.16'
api 'org.apache.httpcomponents:httpmime:4.5.14'
api group: 'commons-beanutils', name: 'commons-beanutils', version: '1.9.4'
api 'commons-net:commons-net:3.11.1'
testImplementation platform("org.spockframework:spock-bom:2.3-groovy-4.0")
testImplementation "org.spockframework:spock-core"
testImplementation "org.spockframework:spock-junit4" // you can remove this if your code does not rely on old JUnit 4 rules
testImplementation "org.apache.groovy:groovy-all:4.0.24"
// testImplementation "org.spockframework:spock-core:2.3-groovy-3.0"
}
if (isReleaseVersion) {
apply plugin: "io.github.gradle-nexus.publish-plugin"
nexusPublishing {
repositories {
sonatype {
if(project.hasProperty('mavenUser')) {
username = mavenUser
password = mavenPassword
}
}
}
}
} else {
}
publishing {
publications {
maven(MavenPublication) {
artifactId 'hcl4j'
pom.withXml {
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
name 'hcl4j'
description 'Hashicorp Configuration Language (HCL) Java Parser'
url 'https://github.com/bertramdev/hcl4j'
scm {
url 'https://github.com/bertramdev/hcl4j'
connection 'scm:https://[email protected]/bertramdev/hcl4j.git'
developerConnection 'scm:git://github.com/bertramdev/hcl4j.git'
}
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/license/LICENSE-2.0.txt'
distribution 'repo'
}
}
developers {
developer {
id 'davydotcom'
name 'David Estes'
email '[email protected]'
}
}
}
}
from components.java
}
}
}
//Define bintrayUser and bintrayKey in ~/.gradle/gradle.properties
// bintray {
// if(project.hasProperty('bintrayUser')) {
// user = bintrayUser
// key = bintrayKey
// }
// publications = ['maven']
// pkg {
// repo = 'gomorpheus'
// userOrg = 'bertramlabs'
// name = 'hcl4j'
// vcsUrl = 'https://github.com/bertramdev/hcl4j.git'
// licenses = ['Apache-2.0']
// }
// }
// task javadocJar(type: Jar, dependsOn: javadoc) {
// archiveClassifier = 'javadoc'
// from 'build/docs/javadoc'
// }
// task sourcesJar(type: Jar, dependsOn: jflex) {
// archiveClassifier = 'sources'
// from sourceSets.main.allSource
// }
task morpheusJavaDoc(type: Javadoc) {
source = sourceSets.main.allJava
title = "Hcl4j Docs"
}
task(console, dependsOn: 'classes', type: JavaExec) {
main = 'groovy.ui.Console'
classpath = sourceSets.main.runtimeClasspath
}
test {
useJUnitPlatform()
testLogging {
exceptionFormat = 'full'
showStandardStreams = true
}
}
sourcesJar.dependsOn('generateJflex')
afterEvaluate {
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("publish") }
sign publishing.publications.maven
}
}
tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}
//do not generate extra load on Nexus with new staging repository if signing fails
tasks.withType(io.github.gradlenexus.publishplugin.InitializeNexusStagingRepository).configureEach {
shouldRunAfter(tasks.withType(Sign))
}