-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle
188 lines (165 loc) · 6.14 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
def scalaMajorVersion = gradle.ext.scalaMajorVersion
def scalaMinorVersion = gradle.ext.scalaMinorVersion
buildscript {
repositories {
mavenCentral()
gradlePluginPortal()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.hierynomus.gradle.plugins:license-gradle-plugin:0.16.1"
}
// NOTE(mccartney, 2022-07-11): Keeping these versions here works with Dependabot. Moving to gradle.properties does not.
ext.commonsCliVersion = '1.9.0'
ext.commonsIoVersion = '2.17.0'
ext.jlineVersion = '2.14.6'
ext.jodaTimeVersion = '2.13.0'
ext.junitVersion = '4.13.2'
ext.mockitoVersion = '4.8.1'
ext.scalaSlackClientVersion = '1.0.1'
ext.scalatestVersion = '3.0.9'
ext.slf4jVersion = '2.0.16'
ext.velocityVersion = '2.4.1'
}
allprojects {
apply plugin: "java"
apply plugin: "scala"
apply plugin: "maven-publish"
apply plugin: "com.github.hierynomus.license"
apply plugin: "signing"
group = "com.sumologic.shellbase"
description = "Sumo Logic's Scala-based interactive shell framework"
version = '5.0.2-SNAPSHOT'
sourceCompatibility = javaSourceVersion
targetCompatibility = javaTargetVersion
repositories {
mavenCentral()
}
dependencies {
testImplementation "org.scalatest:scalatest_${scalaMajorVersion}:${scalatestVersion}"
testImplementation "junit:junit:${junitVersion}"
testImplementation "org.mockito:mockito-core:${mockitoVersion}"
}
compileScala {
scalaCompileOptions.additionalParameters = [
"-feature",
"-target:jvm-1.8",
"-deprecation",
"-language:implicitConversions",
"-unchecked",
// TODO: (fdaca 2019-11-18) please consider repairing warnings and enabling this
//"-Xfatal-warnings"
]
}
test {
maxHeapSize = '2g'
testLogging {
events 'started', 'failed', 'passed', 'skipped'
showStandardStreams = true
}
}
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
license {
header rootProject.file('src/etc/header.txt')
strictCheck true
exclude "**/warning.txt"
}
}
subprojects {
ext.gitCommitIdAbbrev = System.getenv('GIT_COMMIT_ID_ABBREV') ?: 'git rev-parse --verify --short=12 HEAD'.execute().text.trim()
task sourcesJar(type: Jar, dependsOn: classes) {
archiveClassifier.set('sources')
from(sourceSets.main.allJava) {
expand(project: [version: project.version], git: [commit: [id: [abbrev: gitCommitIdAbbrev]]])
}
from(sourceSets.main.allScala)
}
task javadocJar(type: Jar, dependsOn: scaladoc) {
from javadoc
from scaladoc
archiveClassifier.set('javadoc')
}
publishing {
publications {
maven(MavenPublication) {
groupId(project.group)
artifactId(project.name + "_${scalaMajorVersion}")
version(project.version)
pom {
name = project.name
description = project.description
url = 'https://github.com/SumoLogic/shellbase'
licenses {
license {
name = 'Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'goledzki'
name = 'Greg Oledzki'
organization = 'Sumo Logic'
}
}
scm {
connection = 'scm:git:[email protected]:SumoLogic/shellbase.git'
developerConnection = 'scm:git:[email protected]:SumoLogic/shellbase.git'
url = 'https://github.com/SumoLogic/shellbase'
tag = 'HEAD'
}
}
from(components.java)
artifact(sourcesJar)
artifact(javadocJar)
}
}
repositories {
maven {
url 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials {
username project.findProperty('nexus_username') ?: ""
password project.findProperty('nexus_password') ?: ""
}
}
}
}
signing {
useGpgCmd()
sign publishing.publications.maven
}
}
project(':shellbase-core') {
dependencies {
implementation "joda-time:joda-time:${jodaTimeVersion}"
implementation "org.slf4j:slf4j-api:${slf4jVersion}"
implementation "commons-cli:commons-cli:${commonsCliVersion}"
implementation "commons-io:commons-io:${commonsIoVersion}"
implementation "jline:jline:${jlineVersion}"
implementation "org.apache.velocity:velocity-engine-core:${velocityVersion}"
implementation "org.scala-lang:scala-library:${scalaMajorVersion}.${scalaMinorVersion}"
}
}
project(':shellbase-example') {
dependencies {
implementation project(':shellbase-core')
implementation "jline:jline:${jlineVersion}"
implementation "org.scala-lang:scala-library:${scalaMajorVersion}.${scalaMinorVersion}"
implementation "org.apache.velocity:velocity-engine-core:${velocityVersion}"
implementation "commons-cli:commons-cli:${commonsCliVersion}"
}
}
project(':shellbase-slack') {
dependencies {
implementation project(':shellbase-core')
implementation "com.github.slack-scala-client:slack-scala-client_${scalaMajorVersion}:${scalaSlackClientVersion}"
implementation "jline:jline:${jlineVersion}"
implementation "org.slf4j:slf4j-api:${slf4jVersion}"
implementation "org.apache.velocity:velocity-engine-core:${velocityVersion}"
implementation "commons-cli:commons-cli:${commonsCliVersion}"
}
}