-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
107 lines (92 loc) · 3.07 KB
/
build.gradle.kts
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
plugins {
`java-library`
kotlin("jvm") version "1.6.0"
id("org.jetbrains.dokka") version "1.6.0"
`maven-publish`
signing
}
group = "eu.timerertim.knevo"
version = "0.2.0-RC"
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib"))
implementation(kotlin("reflect"))
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0-RC")
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.1")
}
tasks.test {
useJUnitPlatform()
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions.jvmTarget = "11"
}
val GPG_SIGNING_KEY: String? by project
val GPG_SIGNING_PASSWORD: String? by project
val MAVEN_UPLOAD_USER: String? by project
val MAVEN_UPLOAD_PWD: String? by project
tasks {
register("sourcesJar", Jar::class) {
dependsOn(JavaPlugin.CLASSES_TASK_NAME)
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}
register("javadocJar", Jar::class) {
dependsOn("dokkaJavadoc")
archiveClassifier.set("javadoc")
from(dokkaJavadoc)
}
}
publishing {
repositories {
maven {
name = "MavenCentral"
val releasesRepoUrl = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2"
val snapshotsRepoUrl = "https://s01.oss.sonatype.org/content/repositories/snapshots"
url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl)
credentials {
username = MAVEN_UPLOAD_USER
password = MAVEN_UPLOAD_PWD
}
}
}
publications {
create<MavenPublication>("core") {
from(components["java"])
artifact(tasks["sourcesJar"])
artifact(tasks["javadocJar"])
pom {
name.set("Knevo")
description.set(
"Kotlin (and Java) Neuroevolution library featuring multiple algorithms, coroutines " +
"and serialization"
)
url.set("knevo.timerertim.eu")
licenses {
license {
name.set("MIT License")
url.set("https://raw.githubusercontent.com/TimerErTim/Knevo/master/LICENSE")
}
}
developers {
developer {
id.set("timerertim")
name.set("Tim Peko")
email.set("timerertim@gmail.com")
}
}
scm {
connection.set("scm:git:https://github.com/TimerErTim/Knevo.git")
developerConnection.set("scm:git:https://github.com/TimerErTim/Knevo.git")
url.set("https://github.com/TimerErTim/Knevo")
}
}
}
}
}
signing {
useInMemoryPgpKeys(GPG_SIGNING_KEY, GPG_SIGNING_PASSWORD)
sign(publishing.publications["core"])
}