Skip to content

Commit 2835de8

Browse files
author
Nikita Stroganov
committed
#181 Update utbot-gradle build file for publishing
1 parent 0d7bfde commit 2835de8

1 file changed

Lines changed: 44 additions & 7 deletions

File tree

utbot-gradle/build.gradle

Lines changed: 44 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,69 @@
11
plugins {
22
id 'java-gradle-plugin'
3+
id 'com.gradle.plugin-publish' version '0.18.0'
4+
id 'com.github.johnrengelman.shadow' version '6.1.0'
35
}
46

57
apply from: "${parent.projectDir}/gradle/include/jvm-project.gradle"
68

79
dependencies {
8-
api project(":utbot-framework")
10+
shadow gradleApi()
11+
shadow localGroovy()
12+
13+
implementation project(":utbot-framework")
914

1015
implementation group: 'io.github.microutils', name: 'kotlin-logging', version: kotlin_logging_version
1116
}
1217

18+
// needed to prevent inclusion of gradle-api into shadow JAR
19+
configurations.compile.dependencies.remove dependencies.gradleApi()
20+
1321
configurations.all {
1422
exclude group: "org.apache.logging.log4j", module: "log4j-slf4j-impl"
1523
}
1624

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(' ')
2329
}
2430
}
2531

32+
shadowJar {
33+
archiveClassifier.set('')
34+
}
35+
36+
tasks.withType(GenerateModuleMetadata) {
37+
enabled = false
38+
}
39+
2640
publishing {
41+
publications {
42+
pluginPublication(MavenPublication) {
43+
// should be empty
44+
}
45+
}
2746
repositories {
2847
maven {
2948
url = layout.buildDirectory.dir('repo')
3049
}
3150
}
3251
}
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

Comments
 (0)