-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
168 lines (140 loc) · 5.27 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
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
val kotlinVersion: String = "1.7.21"
plugins {
kotlin("jvm") version "1.7.21"
id("com.adarshr.test-logger") version "3.2.0"
`maven-publish`
signing
}
repositories {
mavenCentral()
}
group = "io.github.kscripting"
version = "0.5.2"
sourceSets {
create("integration") {
// test { //With that idea can understand that 'integration' is test source set and do not complain about test
// names starting with upper case, but it doesn't compile correctly with it
java.srcDir("$projectDir/src/integration/kotlin")
resources.srcDir("$projectDir/src/integration/resources")
compileClasspath += main.get().output + test.get().output
runtimeClasspath += main.get().output + test.get().output
}
// }
}
configurations {
get("integrationImplementation").apply { extendsFrom(get("testImplementation")) }
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
withJavadocJar()
withSourcesJar()
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().all {
kotlinOptions {
jvmTarget = "1.8"
}
}
tasks.create<Test>("integration") {
val itags = System.getProperty("includeTags") ?: ""
val etags = System.getProperty("excludeTags") ?: ""
useJUnitPlatform {
if (itags.isNotBlank()) {
includeTags(itags)
}
if (etags.isNotBlank()) {
excludeTags(etags)
}
}
systemProperty("osType", System.getProperty("osType"))
systemProperty("projectPath", projectDir.absolutePath)
systemProperty("shellPath", System.getProperty("shellPath"))
description = "Runs the integration tests."
group = "verification"
testClassesDirs = sourceSets["integration"].output.classesDirs
classpath = sourceSets["integration"].runtimeClasspath
outputs.upToDateWhen { false }
mustRunAfter(tasks["test"])
//dependsOn(tasks["assemble"], tasks["test"])
doLast {
println("Include tags: $itags")
println("Exclude tags: $etags")
}
}
tasks.create<Task>("printIntegrationClasspath") {
doLast {
println(sourceSets["integration"].runtimeClasspath.asPath)
}
}
testlogger {
showStandardStreams = true
showFullStackTraces = false
}
tasks.test {
useJUnitPlatform()
}
publishing {
publications {
create<MavenPublication>("mavenJava") {
artifactId = "shell"
from(components["java"])
pom {
name.set("kscript")
description.set("Shell - library for interoperability with different system shells")
url.set("https://github.com/kscripting/shell")
licenses {
license {
name.set("MIT License")
url.set("https://opensource.org/licenses/MIT")
}
}
developers {
developer {
id.set("aartiPl")
name.set("Marcin Kuszczak")
email.set("aarti@interia.pl")
}
}
scm {
connection.set("scm:git:git://https://github.com/kscripting/shell.git")
developerConnection.set("scm:git:ssh:https://github.com/kscripting/shell.git")
url.set("https://github.com/kscripting/shell")
}
}
}
}
repositories {
maven {
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 (project.version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl)
credentials {
username = project.findProperty("sonatype.user") as String? ?: System.getenv("SONATYPE_USER")
password = project.findProperty("sonatype.password") as String? ?: System.getenv("SONATYPE_PASSWORD")
}
}
}
}
signing {
sign(publishing.publications["mavenJava"])
}
dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion")
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
implementation("org.jetbrains.kotlin:kotlin-scripting-common:$kotlinVersion")
implementation("org.jetbrains.kotlin:kotlin-scripting-jvm:$kotlinVersion")
implementation("org.jetbrains.kotlin:kotlin-scripting-dependencies-maven-all:$kotlinVersion")
implementation("io.arrow-kt:arrow-core:1.1.2")
implementation("org.apache.commons:commons-lang3:3.12.0")
implementation("org.slf4j:slf4j-nop:2.0.4")
testImplementation("org.junit.platform:junit-platform-suite-engine:1.9.0")
testImplementation("org.junit.platform:junit-platform-suite-api:1.9.0")
testImplementation("org.junit.platform:junit-platform-suite-commons:1.9.0")
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.9.0")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.9.0")
testImplementation("com.willowtreeapps.assertk:assertk-jvm:0.25")
testImplementation("io.mockk:mockk:1.13.2")
testImplementation(kotlin("script-runtime"))
}