Skip to content

Commit 4a81373

Browse files
committed
Configuring outputFile properly to hopefully make the task cacheable. Also upgrade version to 1.0.7
1 parent c1e2c30 commit 4a81373

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ plugins {
88

99
allprojects {
1010
group = "com.faire.gradle"
11-
version = "1.0.5"
11+
version = "1.0.6"
1212

1313
repositories {
1414
mavenCentral()

src/main/kotlin/com/faire/gradle/analyze/AnalyzeDependenciesTask.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import org.gradle.api.file.FileCollection
77
import org.gradle.api.tasks.CacheableTask
88
import org.gradle.api.tasks.Input
99
import org.gradle.api.tasks.InputFiles
10+
import org.gradle.api.tasks.OutputFile
1011
import org.gradle.api.tasks.PathSensitive
1112
import org.gradle.api.tasks.PathSensitivity
1213
import org.gradle.api.tasks.TaskAction
@@ -29,6 +30,9 @@ open class AnalyzeDependenciesTask : DefaultTask() {
2930
@Input
3031
var includedPackageFilters: List<String> = listOf()
3132

33+
@OutputFile
34+
var outFile = project.buildDir.resolve("buildozerOutput.txt")
35+
3236
private fun applyAnalysisResultToBuffer(
3337
outputBuffer: StringBuffer,
3438
problemArtifacts: Set<ResolvedArtifact>,
@@ -99,6 +103,9 @@ open class AnalyzeDependenciesTask : DefaultTask() {
99103
TEST_UNNECESSARY_PERMIT_UNUSED_DECLARED_MSG
100104
)
101105

106+
val output = buffer.toString()
107+
outFile.writeText(output)
108+
102109
if (!buffer.isEmpty()) {
103110
val message = "Dependency analysis found issues.\n$buffer"
104111
if (justWarn) {

0 commit comments

Comments
 (0)