-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
108 lines (99 loc) · 3.07 KB
/
build.gradle
File metadata and controls
108 lines (99 loc) · 3.07 KB
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 'org.jetbrains.kotlin.jvm' version '2.0.21'
id 'java-library'
id 'groovy'
id 'maven-publish'
id 'signing'
id 'pl.allegro.tech.build.axion-release' version '1.18.13'
}
group 'pl.tfij'
archivesBaseName = 'bright-cache'
version scmVersion.version
repositories {
mavenCentral()
}
dependencies {
implementation 'org.jetbrains.kotlin:kotlin-stdlib'
implementation 'com.google.guava:guava:33.3.1-jre'
testImplementation 'org.spockframework:spock-core:2.3-groovy-4.0'
}
tasks.named('jar') {
manifest {
attributes(
'Implementation-Title': project.name,
'Implementation-Version': project.version
)
}
}
test {
useJUnitPlatform()
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
sonatype(MavenPublication) {
artifactId = 'bright-cache'
from components.java
versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}
pom {
name = 'bright-cache'
description = 'Simple two layer cache.'
url = 'https://github.com/tfij/BrightCache'
licenses {
license {
name.set('The Apache License, Version 2.0')
url.set('http://www.apache.org/licenses/LICENSE-2.0.txt')
}
}
developers {
developer {
id = 'tfij'
name = 'Tomasz Fijakowski'
email = 'tomasz@chi.pl'
}
}
scm {
connection = 'scm:git:https://github.com/tfij/result.git'
developerConnection = 'scm:git:https://github.com/tfij/result.git'
url = 'https://github.com/tfij/result.git'
}
}
}
}
repositories {
maven {
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots/'
url = (version.toString().endsWith('SNAPSHOT')) ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = System.getenv('SONATYPE_USERNAME')
password = System.getenv('SONATYPE_PASSWORD')
}
}
}
}
if (!(System.getenv('SIGNING_GPG_KEY_ID') as String)?.isEmpty()) {
signing {
useInMemoryPgpKeys(
System.getenv('SIGNING_GPG_KEY_ID') as String,
System.getenv('SIGNING_GPG_PRIVATE_KEY') as String,
System.getenv('SIGNING_GPG_PRIVATE_KEY_PASSWORD') as String
)
sign publishing.publications.sonatype
}
}
javadoc {
if(JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}