Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ include 'temporal-kotlin'
include 'temporal-spring-boot-autoconfigure'
include 'temporal-spring-boot-starter'
include 'temporal-remote-data-encoder'
include 'temporal-shaded'
include 'temporal-shaded'
include 'temporal-workflowcheck'
325 changes: 325 additions & 0 deletions temporal-workflowcheck/README.md

Large diffs are not rendered by default.

44 changes: 44 additions & 0 deletions temporal-workflowcheck/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
plugins {
id 'application'
id 'com.gradleup.shadow' version '8.3.3'
}

description = 'Temporal Java WorkflowCheck Static Analyzer'

dependencies {
implementation 'org.ow2.asm:asm:9.6'
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 {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unlike the -shaded project, we just need the -all.jar this generates, and we only have one real dependency anyways

relocate 'org.objectweb.asm', 'io.temporal.workflowcheck.shaded.org.objectweb.asm'
}
build.dependsOn shadowJar

// Access Java test source as resource
tasks.register('copyJavaSourcesToResources') {
doLast {
copy {
from('src/test/java') {
include '**/*.*'
}
into 'build/resources/test'
}
}
}
processTestResources.dependsOn copyJavaSourcesToResources

spotless {
java {
toggleOffOn()
}
}
3 changes: 3 additions & 0 deletions temporal-workflowcheck/samples/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
gradle/build
gradle-multi-project/project-app/build
gradle-multi-project/project-workflows/build
18 changes: 18 additions & 0 deletions temporal-workflowcheck/samples/gradle-multi-project/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Temporal Workflow Check for Java - Gradle Sample

This sample shows how to incorporate `workflowcheck` into a Gradle build that has multiple projects. Currently there are
no published releases, so this example includes the primary build in the [settings.gradle](settings.gradle) file. But
users may just want to reference a published JAR when it is available.

To run:

gradlew check

This will output something like:

```
Analyzing classpath for classes with workflow methods...
Found 1 class(es) with workflow methods
Workflow method io.temporal.workflowcheck.sample.gradlemulti.workflows.MyWorkflowImpl.errorAtNight() (declared on io.temporal.workflowcheck.sample.gradlemulti.workflows.MyWorkflow) has 1 invalid member access:
MyWorkflowImpl.java:10 invokes java.time.LocalTime.now() which is configured as invalid
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
plugins {
id 'java'
}

allprojects {
repositories {
mavenCentral()
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#Sun Dec 24 20:45:25 CST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
234 changes: 234 additions & 0 deletions temporal-workflowcheck/samples/gradle-multi-project/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading