|
1 | 1 | plugins { |
2 | 2 | id 'java-gradle-plugin' |
| 3 | + id 'com.gradle.plugin-publish' version '0.18.0' |
| 4 | + id 'com.github.johnrengelman.shadow' version '6.1.0' |
3 | 5 | } |
4 | 6 |
|
5 | 7 | apply from: "${parent.projectDir}/gradle/include/jvm-project.gradle" |
6 | 8 |
|
7 | 9 | dependencies { |
8 | | - api project(":utbot-framework") |
| 10 | + shadow gradleApi() |
| 11 | + shadow localGroovy() |
| 12 | + |
| 13 | + implementation project(":utbot-framework") |
9 | 14 |
|
10 | 15 | implementation group: 'io.github.microutils', name: 'kotlin-logging', version: kotlin_logging_version |
11 | 16 | } |
12 | 17 |
|
| 18 | +// needed to prevent inclusion of gradle-api into shadow JAR |
| 19 | +configurations.compile.dependencies.remove dependencies.gradleApi() |
| 20 | + |
13 | 21 | configurations.all { |
14 | 22 | exclude group: "org.apache.logging.log4j", module: "log4j-slf4j-impl" |
15 | 23 | } |
16 | 24 |
|
17 | | -gradlePlugin { |
18 | | - plugins { |
19 | | - sarifReportPlugin { |
20 | | - id = 'org.utbot.gradle.plugin' |
21 | | - implementationClass = 'org.utbot.gradle.plugin.SarifGradlePlugin' |
22 | | - } |
| 25 | +jar { |
| 26 | + manifest { |
| 27 | + attributes 'JAR-Type': 'Fat JAR' |
| 28 | + attributes 'Class-Path': configurations.compile.collect { it.getName() }.join(' ') |
23 | 29 | } |
24 | 30 | } |
25 | 31 |
|
| 32 | +shadowJar { |
| 33 | + archiveClassifier.set('') |
| 34 | +} |
| 35 | + |
| 36 | +tasks.withType(GenerateModuleMetadata) { |
| 37 | + enabled = false |
| 38 | +} |
| 39 | + |
26 | 40 | publishing { |
| 41 | + publications { |
| 42 | + pluginPublication(MavenPublication) { |
| 43 | + // should be empty |
| 44 | + } |
| 45 | + } |
27 | 46 | repositories { |
28 | 47 | maven { |
29 | 48 | url = layout.buildDirectory.dir('repo') |
30 | 49 | } |
31 | 50 | } |
32 | 51 | } |
| 52 | + |
| 53 | +pluginBundle { |
| 54 | + website = 'https://www.utbot.org/' |
| 55 | + vcsUrl = 'https://github.com/UnitTestBot/UTBotJava/' |
| 56 | + tags = ['java', 'unit-testing', 'tests-generation', 'sarif'] |
| 57 | +} |
| 58 | + |
| 59 | +gradlePlugin { |
| 60 | + plugins { |
| 61 | + sarifReportPlugin { |
| 62 | + id = 'org.utbot.gradle.plugin' |
| 63 | + version = '1.0.0' |
| 64 | + displayName = 'UnitTestBot gradle plugin' |
| 65 | + description = 'The gradle plugin for generating tests and creating SARIF reports based on UnitTestBot' |
| 66 | + implementationClass = 'org.utbot.gradle.plugin.SarifGradlePlugin' |
| 67 | + } |
| 68 | + } |
| 69 | +} |
0 commit comments