-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
108 lines (92 loc) · 2.96 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
plugins {
id 'java-library'
id 'signing'
id 'maven-publish'
id('io.github.gradle-nexus.publish-plugin') version '1.1.0'
}
group 'io.github.balazskreith.hamok'
version '1.0.0'
apply plugin: 'maven-publish'
apply plugin: 'signing'
repositories {
mavenCentral()
}
java {
sourceCompatibility = JavaVersion.toVersion("17")
targetCompatibility = JavaVersion.toVersion("17")
withJavadocJar()
withSourcesJar()
}
dependencies {
implementation "io.reactivex.rxjava3:rxjava:3.1.5"
implementation 'org.slf4j:slf4j-api:1.7.30'
implementation 'com.google.protobuf:protobuf-java:3.19.4'
testImplementation group: 'ch.qos.logback', name: 'logback-classic', version: '1.2.11'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testImplementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.13.3'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}
nexusPublishing {
repositories {
sonatype {
nexusUrl.set(uri("https://s01.oss.sonatype.org/service/local/"))
snapshotRepositoryUrl.set(uri("https://s01.oss.sonatype.org/content/repositories/snapshots/"))
}
}
}
publishing {
publications {
mavenJava(MavenPublication) {
from(components.java)
pom {
name = 'hamok-java-core'
description = 'Light and convinient way to create a distributed object storage'
url = 'https://github.com/balazskreith/hamok'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'balazskreith'
name = 'Balazs Kreith'
}
}
scm {
url = 'https://github.com/balazskreith/hamok'
connection = 'scm:git://github.com/balazskreith/hamok.git'
developerConnection = 'scm:git://github.com/balazskreith/hamok.git'
}
}
}
}
}
// for snapshots
signing {
sign publishing.publications.mavenJava
}
// for production
//signing {
// def signingKey = findProperty("signingKey")
// def signingPassword = findProperty("signingPassword")
// useInMemoryPgpKeys(signingKey, signingPassword)
// sign publishing.publications.mavenJava
//}
ext.genOutputDir = file("$buildDir/generated-resources")
task generateVersionTxt() {
ext.outputFile = file("$genOutputDir/version.txt")
outputs.file(outputFile)
doLast {
outputFile.text = """GroupId: ${project.group}
Name: ${project.name}
Version: $version
Build-time: ${java.time.LocalDateTime.now()}
"""
}
}
sourceSets.main.output.dir genOutputDir, builtBy: generateVersionTxt
test {
useJUnitPlatform()
}