Skip to content

Commit 4a2e56e

Browse files
committed
workflowcheck - initial support for Java static analyzer
1 parent 53a8af7 commit 4a2e56e

File tree

50 files changed

+4617
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+4617
-1
lines changed

settings.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ include 'temporal-kotlin'
99
include 'temporal-spring-boot-autoconfigure'
1010
include 'temporal-spring-boot-starter'
1111
include 'temporal-remote-data-encoder'
12-
include 'temporal-shaded'
12+
include 'temporal-shaded'
13+
include 'temporal-workflowcheck'

temporal-workflowcheck/README.md

Lines changed: 325 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
plugins {
2+
id 'application'
3+
id 'com.gradleup.shadow' version '8.3.3'
4+
}
5+
6+
description = 'Temporal Java WorkflowCheck Static Analyzer'
7+
8+
dependencies {
9+
implementation 'org.ow2.asm:asm:9.6'
10+
compileOnly 'com.google.code.findbugs:jsr305:3.0.2'
11+
testImplementation project(":temporal-sdk")
12+
testImplementation "junit:junit:${junitVersion}"
13+
// Only for testing external-JAR-based bad calls
14+
testImplementation "com.google.guava:guava:$guavaVersion"
15+
}
16+
17+
application {
18+
mainClass = 'io.temporal.workflowcheck.Main'
19+
}
20+
21+
// Need all-in-one JAR
22+
shadowJar {
23+
relocate 'org.objectweb.asm', 'io.temporal.workflowcheck.shaded.org.objectweb.asm'
24+
}
25+
build.dependsOn shadowJar
26+
27+
// Access Java test source as resource
28+
tasks.register('copyJavaSourcesToResources') {
29+
doLast {
30+
copy {
31+
from('src/test/java') {
32+
include '**/*.*'
33+
}
34+
into 'build/resources/test'
35+
}
36+
}
37+
}
38+
processTestResources.dependsOn copyJavaSourcesToResources
39+
40+
spotless {
41+
java {
42+
toggleOffOn()
43+
}
44+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
gradle/build
2+
gradle-multi-project/project-app/build
3+
gradle-multi-project/project-workflows/build
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Temporal Workflow Check for Java - Gradle Sample
2+
3+
This sample shows how to incorporate `workflowcheck` into a Gradle build that has multiple projects. Currently there are
4+
no published releases, so this example includes the primary build in the [settings.gradle](settings.gradle) file. But
5+
users may just want to reference a published JAR when it is available.
6+
7+
To run:
8+
9+
gradlew check
10+
11+
This will output something like:
12+
13+
```
14+
Analyzing classpath for classes with workflow methods...
15+
Found 1 class(es) with workflow methods
16+
Workflow method io.temporal.workflowcheck.sample.gradlemulti.workflows.MyWorkflowImpl.errorAtNight() (declared on io.temporal.workflowcheck.sample.gradlemulti.workflows.MyWorkflow) has 1 invalid member access:
17+
MyWorkflowImpl.java:10 invokes java.time.LocalTime.now() which is configured as invalid
18+
```
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
plugins {
2+
id 'java'
3+
}
4+
5+
allprojects {
6+
repositories {
7+
mavenCentral()
8+
}
9+
}
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Sun Dec 24 20:45:25 CST 2023
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
5+
zipStoreBase=GRADLE_USER_HOME
6+
zipStorePath=wrapper/dists

temporal-workflowcheck/samples/gradle-multi-project/gradlew

Lines changed: 234 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)