Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tidyup #206

Merged
merged 4 commits into from
Jun 25, 2024
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
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ gradlePlugin {
id = 'org.scoverage'
implementationClass = 'org.scoverage.ScoveragePlugin'
displayName = 'Gradle Scoverage plugin'
description = 'gradle-scoverage is a Gradle plugin for calculating code coverage using Scoverage'
tags.set(['coverage', 'scala', 'scoverage'])
}
}
Expand Down Expand Up @@ -183,6 +184,7 @@ if (project.properties.containsKey('signing.keyId')) {
signing {
sign publishing.publications.mavenJava
}
project.tasks.publishMavenJavaPublicationToMavenRepository.inputs.files(project.tasks.signMavenJavaPublication)
}

// see https://stackoverflow.com/questions/44679007
Expand Down
2 changes: 0 additions & 2 deletions src/functionalTest/java/org/scoverage/CompositeBuildTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ public CompositeBuildTest() {
super("composite-build");
}

@Ignore
@Test
public void buildComposite() {

runComposite("clean", "build");
}

@Ignore
@Test
public void reportComposite() {

Expand Down
21 changes: 2 additions & 19 deletions src/main/groovy/org/scoverage/ScoveragePlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import org.gradle.api.plugins.PluginAware
import org.gradle.api.plugins.scala.ScalaPlugin
import org.gradle.api.tasks.SourceSet
import org.gradle.api.tasks.TaskProvider
import org.gradle.api.tasks.scala.ScalaCompile
import org.gradle.api.tasks.testing.Test

import java.nio.file.Files
Expand Down Expand Up @@ -59,6 +58,8 @@ class ScoveragePlugin implements Plugin<PluginAware> {
visible = false
transitive = true
description = 'Scoverage dependencies'
canBeResolved = true
canBeConsumed = false
}

project.afterEvaluate {
Expand Down Expand Up @@ -399,22 +400,4 @@ class ScoveragePlugin implements Plugin<PluginAware> {
}
}

private Set<? extends Task> recursiveDependenciesOf(Task task, boolean sameProjectOnly) {
def cache = sameProjectOnly ? sameProjectTaskDependencies : crossProjectTaskDependencies
if (!cache.containsKey(task)) {
def directDependencies = task.getTaskDependencies().getDependencies(task)
if (sameProjectOnly) {
directDependencies = directDependencies.findAll {
it.project == task.project
}
}
def nestedDependencies = directDependencies.collect { recursiveDependenciesOf(it, sameProjectOnly) }.flatten()
def dependencies = directDependencies + nestedDependencies

cache.put(task, dependencies)
return dependencies
} else {
return cache.get(task)
}
}
}
Loading