Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions .github/workflows/precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ jobs:
gradle:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# 8.11 = oldest supported version
# wrapper = supposed to be the oldest supported version but actually runs current
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.ebay.plugins.graph.analytics

import org.gradle.api.file.RegularFileProperty
import org.gradle.api.tasks.CacheableTask
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.PathSensitive
import org.gradle.api.tasks.PathSensitivity
Expand All @@ -11,6 +12,7 @@ import org.jgrapht.graph.DefaultDirectedGraph
* Base class which can be used by tasks which need to read the graph file as
* an input (only).
*/
@CacheableTask
abstract class BaseGraphInputTask : BaseGraphPersistenceTask() {
/**
* The graph input to analyze.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ package com.ebay.plugins.graph.analytics

import org.gradle.api.DefaultTask
import org.gradle.api.provider.Property
import org.gradle.api.tasks.CacheableTask
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.Internal

/**
* Base class used for tasks which need to read and write the graph file.
*/
@CacheableTask
abstract class BaseGraphPersistenceTask : DefaultTask() {
// Pass the graph format in so that version changes invalidate the cache
@get:Input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import org.gradle.api.tasks.Input
import org.gradle.api.tasks.InputFile
import org.gradle.api.tasks.Optional
import org.gradle.api.tasks.OutputFile
import org.gradle.api.tasks.PathSensitive
import org.gradle.api.tasks.PathSensitivity
import org.gradle.api.tasks.TaskAction
import org.gradle.api.tasks.options.Option
import org.gradle.work.DisableCachingByDefault
Expand All @@ -23,6 +25,7 @@ internal abstract class DirectComparisonTask : BaseGraphPersistenceTask() {
internal abstract val projectLayout: ProjectLayout

@get:InputFile
@get:PathSensitive(PathSensitivity.NONE)
internal abstract val defaultAnalysisFile: RegularFileProperty

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,18 +231,16 @@ internal class GraphAnalyticsPlugin : Plugin<Any> {
val classifier = graphExtension.configurationClassifier.convention(ConfigurationClassifierDefault()).get()
project.configurations.configureEach { config ->
val configClass = classifier.classify(config)
if (configClass == ConfigurationClass.OTHER) return@configureEach

val (dependenciesConfig, taskProvider) = when(configClass) {
ConfigurationClass.PRODUCTION -> {
Pair(prodDependencies, gatherProdDependenciesTaskProvider)
}
ConfigurationClass.TEST -> {
Pair(testDependencies, gatherTestDependenciesTaskProvider)
}
else -> {
// Should never happen
throw(GradleException("Unsupported config class: $configClass"))
ConfigurationClass.OTHER -> {
// We only care about prod and test dependencies
return@configureEach
}
}

Expand Down