-
Notifications
You must be signed in to change notification settings - Fork 213
Expand file tree
/
Copy pathbuild.gradle
More file actions
70 lines (60 loc) · 1.95 KB
/
build.gradle
File metadata and controls
70 lines (60 loc) · 1.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
plugins {
id 'application'
id 'com.gradleup.shadow' version '8.3.3'
id 'java'
}
description = 'Temporal Java WorkflowCheck Static Analyzer'
dependencies {
implementation 'org.ow2.asm:asm:9.7'
compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
testImplementation project(":temporal-sdk")
testImplementation "junit:junit:${junitVersion}"
// Only for testing external-JAR-based bad calls
testImplementation "com.google.guava:guava:$guavaVersion"
}
application {
mainClass = 'io.temporal.workflowcheck.Main'
}
// Need all-in-one JAR
shadowJar {
relocate 'org.objectweb.asm', 'io.temporal.workflowcheck.shaded.org.objectweb.asm'
archiveClassifier = ''
}
shadowJar.dependsOn(jar)
build.dependsOn shadowJar
distTar.dependsOn shadowJar
distZip.dependsOn shadowJar
startScripts.dependsOn shadowJar
// Configure publishing to publish both regular library jar and shadow executable jar
publishing {
publications {
// Regular library jar for programmatic usage and compile-time annotations.
// That publication is configured by the default setup in publishing.gradle.
// mavenJava(MavenPublication) { ... }
// Fat executable jar with shaded dependencies
shadow(MavenPublication) { publication ->
project.shadow.component(publication)
artifactId = "${project.name}-all"
artifact sourcesJar
artifact javadocJar
}
}
}
// Fix dependency issue with shadow publication metadata generation
tasks.named('generateMetadataFileForShadowPublication').configure {
dependsOn 'jar'
}
// Copy Java test source files to resources so they can be loaded at runtime
tasks.register('copyJavaSourcesToResources', Copy) {
from('src/test/java') {
include '**/*.java'
include '**/*.properties'
}
into 'build/resources/test'
}
processTestResources.dependsOn copyJavaSourcesToResources
spotless {
java {
toggleOffOn()
}
}