11import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2+ import com.github.jengelman.gradle.plugins.shadow.transformers.ComponentsXmlResourceTransformer
23import org.gradle.api.tasks.testing.logging.TestExceptionFormat
34import org.gradle.api.tasks.testing.logging.TestLogEvent
45
5- val kotlinVersion: String = " 1.6.20 "
6+ val kotlinVersion: String = " 1.6.21 "
67
78plugins {
8- kotlin(" jvm" ) version " 1.6.20 "
9+ kotlin(" jvm" ) version " 1.6.21 "
910 application
10- id(" com.github.johnrengelman.shadow" ) version " 6 .1.0 "
11+ id(" com.github.johnrengelman.shadow" ) version " 7 .1.2 "
1112}
1213
1314repositories {
@@ -20,51 +21,57 @@ tasks.test {
2021 useJUnitPlatform()
2122
2223 testLogging {
23- events(TestLogEvent .FAILED ); exceptionFormat = TestExceptionFormat .FULL
24+ events(TestLogEvent .FAILED )
25+ exceptionFormat = TestExceptionFormat .FULL
2426 }
2527}
2628
2729tasks.withType<Test > {
2830 addTestListener(object : TestListener {
29- override fun beforeSuite (suite : TestDescriptor ) { logger.quiet(" \n Test class: ${suite.displayName} " ) }
31+ override fun beforeSuite (suite : TestDescriptor ) {
32+ logger.quiet(" \n Test class: ${suite.displayName} " )
33+ }
34+
3035 override fun beforeTest (testDescriptor : TestDescriptor ) {}
3136 override fun afterTest (testDescriptor : TestDescriptor , result : TestResult ) {
32- logger.quiet(" ${String .format( " %-60s - %-10s" , testDescriptor.name, result.resultType )} " )
37+ logger.quiet(" ${String .format(" %-60s - %-10s" , testDescriptor.name, result.resultType)} " )
3338 }
3439
3540 override fun afterSuite (suite : TestDescriptor , result : TestResult ) {}
3641 })
3742}
3843
39- val launcherClassName: String = " kscript.app.KscriptKt"
44+ val launcherClassName: String = " kscript.app.KscriptKt"
4045
4146dependencies {
4247 implementation(" com.offbytwo:docopt:0.6.0.20150202" )
4348
44- implementation(" org.jetbrains.kotlin:kotlin-scripting-common:$kotlinVersion " )
4549 implementation(" org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion " )
46- implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0-RC3 " )
50+ implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1 " )
4751
52+ implementation(" org.jetbrains.kotlin:kotlin-scripting-common:$kotlinVersion " )
4853 implementation(" org.jetbrains.kotlin:kotlin-scripting-jvm:$kotlinVersion " )
4954 implementation(" org.jetbrains.kotlin:kotlin-scripting-dependencies:$kotlinVersion " )
50- implementation(" org.jetbrains.kotlin:kotlin-scripting-dependencies-maven:$kotlinVersion " )
55+ implementation(" org.jetbrains.kotlin:kotlin-scripting-dependencies-maven-all :$kotlinVersion " )
5156
5257 implementation(" commons-io:commons-io:2.11.0" )
5358 implementation(" commons-codec:commons-codec:1.15" )
5459
55- implementation(" org.slf4j:slf4j-nop:1.7.32 " )
60+ implementation(" org.slf4j:slf4j-nop:1.7.36 " )
5661
5762 testImplementation(" org.junit.jupiter:junit-jupiter-engine:5.8.2" )
5863 testImplementation(" org.junit.jupiter:junit-jupiter-params:5.8.2" )
5964 testImplementation(" com.willowtreeapps.assertk:assertk-jvm:0.25" )
60- testImplementation(" io.mockk:mockk:1.12.1 " )
65+ testImplementation(" io.mockk:mockk:1.12.3 " )
6166
6267 testImplementation(kotlin(" script-runtime" ))
6368}
6469
6570val shadowJar by tasks.getting(ShadowJar ::class ) {
6671 // set empty string to classifier and version to get predictable jar file name: build/libs/kscript.jar
6772 archiveFileName.set(" kscript.jar" )
73+ transform(ComponentsXmlResourceTransformer ())
74+
6875 doLast {
6976 copy {
7077 from(File (projectDir, " src/kscript" ))
@@ -74,7 +81,7 @@ val shadowJar by tasks.getting(ShadowJar::class) {
7481}
7582
7683application {
77- mainClassName = launcherClassName
84+ mainClass.set( launcherClassName)
7885}
7986
8087// Disable standard jar task to avoid building non-shadow jars
0 commit comments