Skip to content

Commit 003122f

Browse files
authored
Add dummy task output for validate and format tasks so they are incremental (#155)
1 parent 6aa1edd commit 003122f

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

smithy-base/src/main/java/software/amazon/smithy/gradle/SmithyBasePlugin.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ private void addFormatTaskForSourceSet(SourceSet sourceSet, SmithySourceDirector
158158
formatTask -> {
159159
formatTask.getModels().set(sds.getSourceDirectories());
160160
formatTask.setEnabled(extension.getFormat().get());
161+
formatTask.getOutputs().upToDateWhen(s -> true);
161162
});
162163

163164
// Smithy files should be formatted before they are built

smithy-jar/src/main/java/software/amazon/smithy/gradle/SmithyJarPlugin.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ private void addJavaTasksForSourceSet(SourceSet sourceSet, SmithyBuildTask build
145145

146146
// Add to verification group, so this tasks shows up in the output of `gradle tasks`
147147
validateTask.setGroup(LifecycleBasePlugin.VERIFICATION_GROUP);
148+
validateTask.getOutputs().upToDateWhen(s -> true);
148149
});
149150
project.getTasks().getByName("test").dependsOn(validateTaskProvider);
150151
}

0 commit comments

Comments
 (0)