1- val kotlinVersion: String = " 1.7.21"
1+ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2+
3+ val kotlinVersion: String = " 2.1.21"
24
35plugins {
4- kotlin(" jvm" ) version " 1.7.21"
5- id(" com.adarshr.test-logger" ) version " 3.2.0"
66 `maven- publish`
7- signing
7+ kotlin(" jvm" ) version " 2.1.21"
8+ id(" com.adarshr.test-logger" ) version " 4.0.0"
9+ id(" com.vanniktech.maven.publish" ) version " 0.33.0"
810}
911
1012repositories {
1113 mavenCentral()
1214}
1315
1416group = " io.github.kscripting"
15- version = " 0.5.2"
16-
17- sourceSets {
18- create(" integration" ) {
19- // test { //With that idea can understand that 'integration' is test source set and do not complain about test
20- // names starting with upper case, but it doesn't compile correctly with it
21- java.srcDir(" $projectDir /src/integration/kotlin" )
22- resources.srcDir(" $projectDir /src/integration/resources" )
23- compileClasspath + = main.get().output + test.get().output
24- runtimeClasspath + = main.get().output + test.get().output
25- }
26- // }
27- }
28-
29- configurations {
30- get(" integrationImplementation" ).apply { extendsFrom(get(" testImplementation" )) }
31- }
32-
33- java {
34- toolchain {
35- languageVersion.set(JavaLanguageVersion .of(8 ))
36- }
37-
38- withJavadocJar()
39- withSourcesJar()
40- }
41-
42- tasks.withType< org.jetbrains.kotlin.gradle.tasks.KotlinCompile > ().all {
43- kotlinOptions {
44- jvmTarget = " 1.8"
45- }
46- }
47-
48- tasks.create<Test >(" integration" ) {
49- val itags = System .getProperty(" includeTags" ) ? : " "
50- val etags = System .getProperty(" excludeTags" ) ? : " "
51-
52- useJUnitPlatform {
53- if (itags.isNotBlank()) {
54- includeTags(itags)
55- }
56-
57- if (etags.isNotBlank()) {
58- excludeTags(etags)
59- }
60- }
17+ version = " 0.6.0"
6118
62- systemProperty(" osType" , System .getProperty(" osType" ))
63- systemProperty(" projectPath" , projectDir.absolutePath)
64- systemProperty(" shellPath" , System .getProperty(" shellPath" ))
65-
66- description = " Runs the integration tests."
67- group = " verification"
68- testClassesDirs = sourceSets[" integration" ].output.classesDirs
69- classpath = sourceSets[" integration" ].runtimeClasspath
70- outputs.upToDateWhen { false }
71- mustRunAfter(tasks[" test" ])
72- // dependsOn(tasks["assemble"], tasks["test"])
73-
74- doLast {
75- println (" Include tags: $itags " )
76- println (" Exclude tags: $etags " )
77- }
19+ kotlin {
20+ jvmToolchain(17 )
7821}
7922
80- tasks.create< Task >( " printIntegrationClasspath " ) {
81- doLast {
82- println (sourceSets[ " integration " ].runtimeClasspath.asPath )
23+ tasks.withType< KotlinCompile >().all {
24+ compilerOptions {
25+ freeCompilerArgs.add( " -Xcontext-parameters " )
8326 }
8427}
8528
@@ -92,77 +35,64 @@ tasks.test {
9235 useJUnitPlatform()
9336}
9437
95- publishing {
96- publications {
97- create<MavenPublication >(" mavenJava" ) {
98- artifactId = " shell"
99- from(components[" java" ])
100-
101- pom {
102- name.set(" kscript" )
103- description.set(" Shell - library for interoperability with different system shells" )
104- url.set(" https://github.com/kscripting/shell" )
105-
106- licenses {
107- license {
108- name.set(" MIT License" )
109- url.set(" https://opensource.org/licenses/MIT" )
110- }
111- }
112- developers {
113- developer {
114- id.set(" aartiPl" )
115- name.set(" Marcin Kuszczak" )
116- email.set(" aarti@interia.pl" )
117- }
118- }
119- scm {
120- connection.set(" scm:git:git://https://github.com/kscripting/shell.git" )
121- developerConnection.set(" scm:git:ssh:https://github.com/kscripting/shell.git" )
122- url.set(" https://github.com/kscripting/shell" )
123- }
124- }
125- }
126- }
38+ // NOTE: deploying snapshots is complicated with this plugin
39+ // It is better to use repository with the staging version of artifact to test it
40+ mavenPublishing {
41+ coordinates(project.group.toString(), project.name, project.version.toString())
12742
128- repositories {
129- maven {
130- val releasesRepoUrl = " https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
131- val snapshotsRepoUrl = " https://s01.oss.sonatype.org/content/repositories/snapshots/"
132- url = uri(if (project.version.toString().endsWith(" SNAPSHOT" )) snapshotsRepoUrl else releasesRepoUrl)
43+ pom {
44+ name.set(" shell" )
45+ description.set(" Shell - library for interoperability with different system shells" )
46+ url.set(" https://github.com/kscripting/shell" )
13347
134- credentials {
135- username = project.findProperty(" sonatype.user" ) as String? ? : System .getenv(" SONATYPE_USER" )
136- password = project.findProperty(" sonatype.password" ) as String? ? : System .getenv(" SONATYPE_PASSWORD" )
48+ licenses {
49+ license {
50+ name.set(" MIT License" )
51+ url.set(" https://opensource.org/licenses/MIT" )
52+ }
53+ }
54+ developers {
55+ developer {
56+ id.set(" aartiPl" )
57+ name.set(" Marcin Kuszczak" )
58+ email.set(" aarti@interia.pl" )
13759 }
13860 }
61+ scm {
62+ connection.set(" scm:git:git://https://github.com/kscripting/shell.git" )
63+ developerConnection.set(" scm:git:ssh:https://github.com/kscripting/shell.git" )
64+ url.set(" https://github.com/kscripting/shell" )
65+ }
13966 }
14067}
14168
142- signing {
143- sign(publishing.publications[" mavenJava" ])
69+ mavenPublishing {
70+ publishToMavenCentral()
71+ signAllPublications()
14472}
14573
14674dependencies {
14775 implementation(" org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion " )
14876 implementation(" org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion " )
149- implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4 " )
77+ implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2 " )
15078
15179 implementation(" org.jetbrains.kotlin:kotlin-scripting-common:$kotlinVersion " )
15280 implementation(" org.jetbrains.kotlin:kotlin-scripting-jvm:$kotlinVersion " )
15381 implementation(" org.jetbrains.kotlin:kotlin-scripting-dependencies-maven-all:$kotlinVersion " )
154- implementation(" io.arrow-kt:arrow-core:1.1.2" )
155- implementation(" org.apache.commons:commons-lang3:3.12.0" )
156-
157- implementation(" org.slf4j:slf4j-nop:2.0.4" )
158-
159- testImplementation(" org.junit.platform:junit-platform-suite-engine:1.9.0" )
160- testImplementation(" org.junit.platform:junit-platform-suite-api:1.9.0" )
161- testImplementation(" org.junit.platform:junit-platform-suite-commons:1.9.0" )
162- testImplementation(" org.junit.jupiter:junit-jupiter-engine:5.9.0" )
163- testImplementation(" org.junit.jupiter:junit-jupiter-params:5.9.0" )
164- testImplementation(" com.willowtreeapps.assertk:assertk-jvm:0.25" )
165- testImplementation(" io.mockk:mockk:1.13.2" )
82+ implementation(" io.arrow-kt:arrow-core:2.1.2" )
83+ implementation(" org.apache.commons:commons-lang3:3.17.0" )
84+
85+ implementation(" org.slf4j:slf4j-nop:2.0.17" )
86+
87+ val junitVersion = " 6.0.0-M1"
88+ testImplementation(" org.junit.platform:junit-platform-suite-engine:$junitVersion " )
89+ testImplementation(" org.junit.platform:junit-platform-suite-api:$junitVersion " )
90+ testImplementation(" org.junit.platform:junit-platform-suite-commons:$junitVersion " )
91+ testImplementation(" org.junit.jupiter:junit-jupiter-engine:$junitVersion " )
92+ testImplementation(" org.junit.jupiter:junit-jupiter-params:$junitVersion " )
93+
94+ testImplementation(" com.willowtreeapps.assertk:assertk-jvm:0.28.1" )
95+ testImplementation(" io.mockk:mockk:1.14.4" )
16696
16797 testImplementation(kotlin(" script-runtime" ))
16898}
0 commit comments