Skip to content

Commit 9b61d44

Browse files
authored
Make workflowcheck -all jar a variant of the main artifact (#2794)
1 parent 20ab984 commit 9b61d44

File tree

9 files changed

+13
-55
lines changed

9 files changed

+13
-55
lines changed

temporal-workflowcheck/README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Temporal Workflow Check for Java
22

3-
Temporal workflowcheck is a utility scans Java bytecode looking for workflow implementation methods that do invalid
3+
Temporal workflowcheck is a utility that scans Java bytecode looking for workflow implementation methods that do invalid
44
things. This mostly centers around
55
[workflow logic constraints](https://docs.temporal.io/dev-guide/java/foundations#workflow-logic-requirements) that
66
require workflows are deterministic. Currently it will catch when a workflow method does any of the following:
@@ -26,8 +26,7 @@ This software is beta quality. We are gathering feedback before considering it s
2626
### Running manually
2727

2828
The all-in-one JAR is best for running manually. Either download the latest version `-all.jar` from
29-
https://repo1.maven.org/maven2/io/temporal/temporal-workflowcheck or build via `gradlew :temporal-workflowcheck:build`
30-
then obtain `-all.jar` in `temporal-workflowcheck/build/libs`.
29+
https://repo1.maven.org/maven2/io/temporal/temporal-workflowcheck or build via `gradlew :temporal-workflowcheck:build` then obtain `-all.jar` in `temporal-workflowcheck/build/libs`.
3130

3231
Simply running the following will show help text:
3332

temporal-workflowcheck/build.gradle

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'application'
3-
id 'com.gradleup.shadow' version '8.3.3'
3+
id 'com.gradleup.shadow' version '8.3.9'
44
id 'java'
55
}
66

@@ -22,36 +22,14 @@ application {
2222
// Need all-in-one JAR
2323
shadowJar {
2424
relocate 'org.objectweb.asm', 'io.temporal.workflowcheck.shaded.org.objectweb.asm'
25-
archiveClassifier = ''
2625
}
26+
2727
shadowJar.dependsOn(jar)
2828
build.dependsOn shadowJar
2929
distTar.dependsOn shadowJar
3030
distZip.dependsOn shadowJar
3131
startScripts.dependsOn shadowJar
3232

33-
// Configure publishing to publish both regular library jar and shadow executable jar
34-
publishing {
35-
publications {
36-
// Regular library jar for programmatic usage and compile-time annotations.
37-
// That publication is configured by the default setup in publishing.gradle.
38-
// mavenJava(MavenPublication) { ... }
39-
40-
// Fat executable jar with shaded dependencies
41-
shadow(MavenPublication) { publication ->
42-
project.shadow.component(publication)
43-
artifactId = "${project.name}-all"
44-
artifact sourcesJar
45-
artifact javadocJar
46-
}
47-
}
48-
}
49-
50-
// Fix dependency issue with shadow publication metadata generation
51-
tasks.named('generateMetadataFileForShadowPublication').configure {
52-
dependsOn 'jar'
53-
}
54-
5533
// Copy Java test source files to resources so they can be loaded at runtime
5634
tasks.register('copyJavaSourcesToResources', Copy) {
5735
from('src/test/java') {
@@ -62,7 +40,6 @@ tasks.register('copyJavaSourcesToResources', Copy) {
6240
}
6341
processTestResources.dependsOn copyJavaSourcesToResources
6442

65-
6643
spotless {
6744
java {
6845
toggleOffOn()

temporal-workflowcheck/samples/gradle-multi-project/README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# Temporal Workflow Check for Java - Gradle Sample
22

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.
3+
This sample shows how to incorporate `workflowcheck` into a Gradle build that has multiple projects.
64

75
To run:
86

temporal-workflowcheck/samples/gradle-multi-project/project-app/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@ configurations {
2323

2424
// Set the dependency
2525
dependencies {
26-
// May want to add :all to the end of the dependency to get the shaded form
27-
workflowcheckDependency 'io.temporal:temporal-workflowcheck:+'
26+
workflowcheckDependency 'io.temporal:temporal-workflowcheck:+:all'
2827
}
2928

3029
// Create the workflowcheck task

temporal-workflowcheck/samples/gradle/README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Temporal Workflow Check for Java - Gradle Sample
22

3-
This sample shows how to incorporate `workflowcheck` into a Gradle build. Currently there are no published releases, so
4-
this example includes the primary build in the [settings.gradle](settings.gradle) file. But users may just want to
5-
reference a published JAR when it is available.
6-
3+
This sample shows how to incorporate `workflowcheck` into a Gradle build.
74
To run:
85

96
gradlew check

temporal-workflowcheck/samples/gradle/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ configurations {
2222

2323
// Set the dependency
2424
dependencies {
25-
// May want to add :all to the end of the dependency to get the shaded form
26-
workflowcheckDependency 'io.temporal:temporal-workflowcheck:+'
25+
workflowcheckDependency 'io.temporal:temporal-workflowcheck:+:all'
2726
}
2827

2928
// Create the workflowcheck task
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
11
rootProject.name = 'temporal-workflowcheck-samples-gradle'
2-
3-
// Add the workflowcheck project as a composite build. We are only doing this
4-
// for the sample, normally this is not needed.
5-
includeBuild '../../../'

temporal-workflowcheck/samples/maven/README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
# Temporal Workflow Check for Java - Maven Sample
22

3-
This sample shows how to incorporate `workflowcheck` into a Maven build. Currently there are no published releases, so
4-
this example expects the primary Gradle to publish the JAR to a local Maven repo that this project references. In the
5-
future, users may just want to reference a published JAR when it is available.
3+
This sample shows how to incorporate `workflowcheck` into a Maven build.
64

7-
To run, first publish the `workflowcheck` JAR to a local repository. ⚠️ WARNING: While there remain no published
8-
releases of workflowcheck, it is currently undocumented on how to publish to a local/disk Maven repo.
5+
To run, execute the following command from this dir:
96

10-
Now with the local repository present, can run the following from this dir:
11-
12-
mvn -U verify
13-
14-
Note, this is a sample using the local repository so that's why we have `-U`. For normal use, `mvn verify` without the
15-
`-U` can be used (and the `<pluginRepositories>` section of the `pom.xml` can be removed).
7+
mvn verify
168

179
This will output something like:
1810

temporal-workflowcheck/samples/maven/pom.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@
9292
<dependency>
9393
<groupId>io.temporal</groupId>
9494
<artifactId>temporal-workflowcheck</artifactId>
95-
<version>1.0-SNAPSHOT</version>
95+
<version>1.33.0</version>
96+
<classifier>all</classifier>
9697
</dependency>
9798
</dependencies>
9899
</plugin>

0 commit comments

Comments
 (0)