|
| 1 | +tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { |
| 2 | + kotlinOptions { |
| 3 | + jvmTarget = JavaVersion.VERSION_11 |
| 4 | + freeCompilerArgs += ["-Xallow-result-return-type", "-Xsam-conversions=class"] |
| 5 | + } |
| 6 | +} |
| 7 | + |
| 8 | +tasks.withType(JavaCompile) { |
| 9 | + sourceCompatibility = JavaVersion.VERSION_1_8 |
| 10 | + targetCompatibility = JavaVersion.VERSION_11 |
| 11 | +} |
| 12 | + |
| 13 | +configurations { |
| 14 | + fetchInstrumentationJar |
| 15 | +} |
| 16 | + |
| 17 | +dependencies { |
| 18 | + implementation project(':utbot-framework') |
| 19 | + implementation project(':utbot-cli') |
| 20 | + implementation project(':utbot-js') |
| 21 | + |
| 22 | + // Without this dependency testng tests do not run. |
| 23 | + implementation group: 'com.beust', name: 'jcommander', version: '1.48' |
| 24 | + implementation group: 'org.junit.platform', name: 'junit-platform-console-standalone', version: junit4PlatformVersion |
| 25 | + implementation group: 'io.github.microutils', name: 'kotlin-logging', version: kotlinLoggingVersion |
| 26 | + implementation group: 'com.github.ajalt.clikt', name: 'clikt', version: cliktVersion |
| 27 | + implementation group: 'org.junit.jupiter', name: 'junit-jupiter-params', version: junit5Version |
| 28 | + implementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: junit5Version |
| 29 | + implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: log4j2Version |
| 30 | + implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: log4j2Version |
| 31 | + implementation group: 'org.json', name: 'json', version: '20220320' |
| 32 | + //noinspection GroovyAssignabilityCheck |
| 33 | + fetchInstrumentationJar project(path: ':utbot-instrumentation', configuration: 'instrumentationArchive') |
| 34 | +} |
| 35 | + |
| 36 | +processResources { |
| 37 | + from(configurations.fetchInstrumentationJar) { |
| 38 | + into "lib" |
| 39 | + } |
| 40 | +} |
| 41 | + |
| 42 | +task createProperties(dependsOn: processResources) { |
| 43 | + doLast { |
| 44 | + new File("$buildDir/resources/main/version.properties").withWriter { w -> |
| 45 | + Properties properties = new Properties() |
| 46 | + //noinspection GroovyAssignabilityCheck |
| 47 | + properties['version'] = project.version.toString() |
| 48 | + properties.store w, null |
| 49 | + } |
| 50 | + } |
| 51 | +} |
| 52 | + |
| 53 | +classes { |
| 54 | + dependsOn createProperties |
| 55 | +} |
| 56 | + |
| 57 | +jar { |
| 58 | + manifest { |
| 59 | + attributes 'Main-Class': 'org.utbot.cli.js.ApplicationKt' |
| 60 | + attributes 'Bundle-SymbolicName': 'org.utbot.cli.js' |
| 61 | + attributes 'Bundle-Version': "${project.version}" |
| 62 | + attributes 'Implementation-Title': 'UtBot JavaScript CLI' |
| 63 | + attributes 'JAR-Type': 'Fat JAR' |
| 64 | + } |
| 65 | + |
| 66 | + archiveVersion.set(project.version as String) |
| 67 | + |
| 68 | + dependsOn configurations.runtimeClasspath |
| 69 | + from { |
| 70 | + configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } |
| 71 | + } |
| 72 | + |
| 73 | + duplicatesStrategy = DuplicatesStrategy.EXCLUDE |
| 74 | +} |
| 75 | + |
0 commit comments