-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.gradle
316 lines (271 loc) · 9.98 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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
ext {
aGroup = 'ru.primetalk'
// To publish to maven central:
// 1. change version — remove SNAPSHOT.
// 2. put _${scalaMajorVersion} in artifact names. (already done)
// 3. enableSigning = true
// 4. issue at shell:
// ./gradlew uploadArchives --no-daemon
// 5. Login to oss sonatype https://oss.sonatype.org/index.html
// 6. Do migration:
// - remove synapse-grid-examples from repository,
// - Close repository,
// - Release repository.
// The artifacts should appear in Maven Central.
//
// aVersion = '1.4.3-SNAPSHOT'
// enableSigning = false
aVersion = '1.4.6-SNAPSHOT'//'1.2.0-SNAPSHOT'
enableSigning = !aVersion.contains('SNAPSHOT')
scalaMajorVersion = '2.11'
scalaFullVersion = "${scalaMajorVersion}.8"
// scalaMajorVersion = '2.10'
// scalaFullVersion = "${scalaMajorVersion}.5"
scalaTest = "org.scalatest:scalatest_${scalaMajorVersion}:3.0.0"
shapelessDep = "com.chuusai:shapeless_${scalaMajorVersion}:2.3.2"
scalaLib = "org.scala-lang:scala-library:${scalaFullVersion}"
scalaReflect = "org.scala-lang:scala-reflect:${scalaFullVersion}"
akkaVersion = '2.4.13'
slf4j = 'org.slf4j:slf4j-api:1.7.21'
logback = 'ch.qos.logback:logback-classic:1.1.7'
rxDep = "io.reactivex:rxscala_${scalaMajorVersion}:0.25.0"
junit = 'junit:junit:4.12'
pegdown = 'org.pegdown:pegdown:1.6.0'
specs2Version = '3.8.6' // 3.6.4
specs2 = "org.specs2:specs2-core_${scalaMajorVersion}:$specs2Version"
specs2Junit = "org.specs2:specs2-junit_${scalaMajorVersion}:$specs2Version"
akka = [
"com.typesafe.akka:akka-actor_$scalaMajorVersion:$akkaVersion",
"com.typesafe.akka:akka-remote_$scalaMajorVersion:$akkaVersion",
"com.typesafe.akka:akka-slf4j_$scalaMajorVersion:$akkaVersion"
]
}
// Troubleshooting:
// gradle OutOfMemoryError: PermGen space:
// JAVAOPTS="-Xmx1024M -XX:MaxPermSize=512M"
task wrapper(type: Wrapper) {
gradleVersion = '3.2'
}
gradle.taskGraph.whenReady { taskGraph ->
if (enableSigning && taskGraph.allTasks.any { it instanceof Sign }) {
// Use Java 6's console to read from the console (no good for a CI environment)
Console console = System.console()
console.printf "\n\nWe have to sign some things in this build.\n\nPlease enter your signing details.\n\n"
def id = "855C7687"//console.readLine("PGP Key Id: ")
def file = "/home/zhizhelev/.gnupg/secring.gpg"//console.readLine("PGP Secret Key Ring File (absolute path): ")
def password = console.readPassword("PGP Private Key Password: ")
allprojects { ext."signing.keyId" = id }
allprojects { ext."signing.secretKeyRingFile" = file }
allprojects { ext."signing.password" = password }
console.printf "\nThanks.\n\n"
}
}
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.github.maiflai:gradle-scalatest:0.14"
}
}
allprojects {
apply plugin: 'idea'
repositories {
mavenCentral()
maven{ url="http://dl.bintray.com/scalaz/releases" }
}
}
subprojects {
apply plugin: 'scala'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'eclipse'
apply plugin: "com.github.maiflai.scalatest"
group = aGroup
version = aVersion
sourceCompatibility = 1.6
targetCompatibility = 1.6
dependencies {
compile scalaLib
testCompile junit
testRuntime pegdown // it is required by scalatest gradle plugin.
testCompile scalaTest
testCompile specs2
testCompile specs2Junit
// {
// exclude group: "org.scalaz.stream" // » scalaz-stream_2.11
// }
}
// making source.jar
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
// making javadoc.jar
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
// adding source.jar and javadoc.jar to artifacts
artifacts {
archives jar
archives sourcesJar
archives javadocJar
}
tasks.withType(ScalaCompile) {
// scalaCompileOptions.useCompileDaemon = true
// optionally specify host and port of the daemon:
// scalaCompileOptions.daemonServer = "localhost:4243"
scalaCompileOptions.additionalParameters = ["-feature"]
}
if(new File(projectDir,"src/test/scala").exists()) {
/**
* Run Spec2 tests
*/
task specs(type: JavaExec, dependsOn: testClasses) {
main = 'org.specs2.runner.files'
args = ['console junitxml html']
classpath sourceSets.main.runtimeClasspath
classpath sourceSets.test.runtimeClasspath
classpath configurations.testRuntime
classpath configurations.runtime
}
test.dependsOn specs
}
/* publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}
repositories {
maven{ // declare properties in ~/.gradle/gradle.properties
url nexusRep
credentials {
username nexusUsername
password nexusPassword
}
}
}
}
*/
configurations {
deployerJars
}
dependencies {
deployerJars "org.apache.maven.wagon:wagon-http:2.9"
}
if (enableSigning) {
apply plugin: 'maven-publish'
uploadArchives {
repositories {
mavenDeployer {
configuration = configurations.deployerJars
// "https://oss.sonatype.org/service/local/staging/deploy/maven2"
// "https://oss.sonatype.org/content/repositories/snapshots"
repository(url: repositoryUrl) {
authentication(userName: repositoryUsername, password: repositoryPassword)
}
// repository (url: nexusRep) {
// authentication(userName: nexusUsername, password: nexusPassword) // declare credentials in ~/.gradle/gradle.properties
// }
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
pom.project {
artifactId "${project.name}_${scalaMajorVersion}"
packaging 'jar'
description 'SynapseGrid is a framework for constructing reactive real-time immutable data flow systems. ' +
'-core contains everything to run a single-threaded system, ' +
'-akka contains everything to run systems over Akka actors, ' +
'-slf4j - enables logging, ' +
'-concurrent - running systems directly over ExecutorContext without the need for Akka, ' +
'-examples - a few test systems. Also there are ' +
'' +
"The current version is $aVersion"
url 'https://github.com/Primetalk/SynapseGrid'
parent {
groupId 'org.sonatype.oss'
artifactId 'oss-parent'
version 7
}
licenses {
license {
name 'BSD Software License, 2-clause version'
url 'https://github.com/Primetalk/SynapseGrid/blob/master/LICENSE.md'
distribution 'repo'
}
}
developers {
developer {
id 'zhizhelev'
name 'Arseniy Zhizhelev'
email 'zhizhelev@primetalk.ru'
}
developer {
id 'nehaev'
name 'Anton Nehaev'
email 'nehaev@primetalk.ru'
}
developer {
id 'popov'
name 'Pavel Popov'
email 'popov@primetalk.ru'
}
}
scm {
url 'https://github.com/Primetalk/SynapseGrid'
connection 'scm:git:git@github.com:Primetalk/SynapseGrid.git'
developerConnection 'scm:git:git@github.com:Primetalk/SynapseGrid.git'
}
}
}
}
}
signing {
required { enableSigning && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
}
}
project(':synapse-grid-core') {}
project(':synapse-grid-slf4j') {
dependencies {
compile project(':synapse-grid-core')
compile slf4j
testRuntime logback
}
}
project(':synapse-grid-akka') {
dependencies {
compile project(':synapse-grid-slf4j')
compile akka
testRuntime logback
}
}
project(':synapse-grid-shapeless') {
dependencies {
compile project(':synapse-grid-core')
compile shapelessDep
}
}
project(':synapse-grid-concurrent') {
dependencies {
compile project(':synapse-grid-core')
compile shapelessDep
}
}
project(':synapse-grid-rx') {
dependencies {
compile project(':synapse-grid-core')
compile rxDep
}
}
project(':synapse-grid-examples') {
uploadArchives.enabled = false
dependencies {
compile project(':synapse-grid-akka')
compile project(':synapse-grid-rx')
testRuntime logback
}
}