-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
128 lines (114 loc) · 3.38 KB
/
build.gradle
File metadata and controls
128 lines (114 loc) · 3.38 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
buildscript {
ext {
kotlinVersion="1.8.21"
junitVersion="5.9.3"
slf4jVersion="2.0.7"
log4jVersion="2.20.0"
}
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
}
}
version = new File('version.txt').text
group = "io.fledware"
def isSnapshot = version.endsWith("SNAPSHOT")
apply plugin: 'java-library'
apply plugin: 'kotlin'
apply plugin: 'idea'
apply plugin: 'maven-publish'
apply plugin: 'signing'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
implementation "org.slf4j:slf4j-api:$slf4jVersion"
testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlinVersion"
testImplementation "org.jetbrains.kotlin:kotlin-test-junit5:$kotlinVersion"
testImplementation "org.junit.jupiter:junit-jupiter-params:$junitVersion"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junitVersion"
testRuntimeOnly "org.apache.logging.log4j:log4j-slf4j2-impl:$log4jVersion"
testRuntimeOnly "org.apache.logging.log4j:log4j-api:$log4jVersion"
testRuntimeOnly "org.apache.logging.log4j:log4j-core:$log4jVersion"
}
compileJava {
options.incremental = true
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
kotlinOptions {
jvmTarget = "11"
freeCompilerArgs += "-Xopt-in=kotlin.RequiresOptIn"
}
}
test {
useJUnitPlatform()
testLogging {
showStandardStreams = true
}
minHeapSize = "512m"
maxHeapSize = "2048m"
}
java {
withSourcesJar()
withJavadocJar()
}
artifacts {
archives javadocJar, sourcesJar
}
publishing {
repositories {
maven {
url = isSnapshot ?
"https://s01.oss.sonatype.org/content/repositories/snapshots/" :
"https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username = findProperty("ossrhUsername") ?: System.getenv("OSSRH_USERNAME")
password = findProperty("ossrhPassword") ?: System.getenv("OSSRH_PASSWORD")
}
}
}
publications {
maven(MavenPublication) {
from components.kotlin
artifact sourcesJar
artifact javadocJar
artifactId = "fledutils"
pom {
name = project.name
packaging = "jar"
description = "A set of utilities common for the fledware code"
url = "https://github.com/fledware/FledUtils/"
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
scm {
connection = "scm:git:git@github.com:fledware/fledutils.git"
developerConnection = "scm:git:git@github.com:fledware/fledutils.git"
url = "https://github.com/fledware/FledUtils/"
}
developers {
developer {
id = 'rexfleischer'
name = 'Rex Fleischer'
}
}
}
}
}
}
signing {
def signingKey = findProperty("signingKey")
def signingPassword = findProperty("signingPassword")
useInMemoryPgpKeys(signingKey, signingPassword)
required { gradle.taskGraph.hasTask("publish") }
sign publishing.publications.maven
}