Skip to content

Commit

Permalink
Add missing task annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
rpalcolea committed Nov 10, 2022
1 parent 977d971 commit bd9dfdb
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class PublishVerificationPlugin implements Plugin<Project> {
}

private static boolean shouldApplyPlugin() {
GradleVersion minVersion = GradleVersion.version("4.9")
GradleVersion minVersion = GradleVersion.version("7.0")
GradleVersion.current() >= minVersion
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import org.gradle.api.BuildCancelledException
import org.gradle.api.DefaultTask
import org.gradle.api.Project
import org.gradle.api.tasks.TaskAction
import org.gradle.work.DisableCachingByDefault

@DisableCachingByDefault
class VerificationReportTask extends DefaultTask {

protected VerificationReportGenerator verificationReportGenerator = new VerificationReportGenerator()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import org.gradle.api.artifacts.result.UnresolvedDependencyResult
import org.gradle.api.tasks.Input
import org.gradle.api.tasks.SourceSet
import org.gradle.api.tasks.TaskAction
import org.gradle.work.DisableCachingByDefault

@DisableCachingByDefault
class VerifyPublicationTask extends DefaultTask {

@Input
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class IvyNebulaSpringBootPublishPluginIntegrationSpec extends IntegrationTestKit
buildFile << """\
plugins {
id 'com.netflix.nebula.ivy-publish'
id 'org.springframework.boot' version '2.5.6'
id 'org.springframework.boot' version '2.7.5'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id "nebula.info" version "11.0.1"
Expand Down Expand Up @@ -106,8 +106,8 @@ public class DemoApplication {
desc.'nebula:Module_Email' == 'nebula@example.test'

and:
assertDependency('org.springframework.boot', 'spring-boot-starter-web', '2.5.6', 'runtime->default')
assertDependency('org.postgresql', 'postgresql', '42.2.24', 'runtime->default')
assertDependency('org.springframework.boot', 'spring-boot-starter-web', '2.7.5', 'runtime->default')
assertDependency('org.postgresql', 'postgresql', '42.3.7', 'runtime->default')

when:
def jar = new File(projectDir, "build/libs/ivypublishingtest-0.1.0.jar")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class MavenNebulaSpringBootPublishPluginIntegrationSpec extends IntegrationTest
buildFile << """\
plugins {
id 'com.netflix.nebula.maven-publish'
id 'org.springframework.boot' version '2.5.6'
id 'org.springframework.boot' version '2.7.5'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
id "com.netflix.nebula.info" version "12.0.0"
Expand Down Expand Up @@ -99,7 +99,7 @@ public class DemoApplication {
def spring = dependencies.find { it.artifactId == 'spring-boot-starter-web' }

then:
spring.version == '2.5.6'
spring.version == '2.7.5'

when:
def jar = new File(projectDir, "build/libs/mavenpublishingtest-0.1.0.jar")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -731,34 +731,6 @@ class PublishVerificationPluginIntegrationSpec extends IntegrationSpec {
noExceptionThrown()
}

def 'plugin should be applied when gradle 4.8 and higher'() {
given:
gradleVersion = version

buildFile << """
${applyPlugin(IvyNebulaPublishPlugin)}
${applyPlugin(PublishVerificationPlugin)}
apply plugin: 'java'
group = 'test.nebula.netflix'
status = 'integration'
version = '1.0'
${publishingRepos()}
"""

when:
def result = runTasksSuccessfully("publishNebulaIvyPublicationToDistIvyRepository", "--dry-run")

then:
result.standardOutput.contains("verifyPublication") == taskPresent

where:
version | taskPresent
"4.8" | false
"4.9" | true
}

def 'unresolved dependencies should fail fast with clear message'() {
given:
def unresolvableDependency = 'unknown:unknown:1.0-SNAPSHOT'
Expand Down

0 comments on commit bd9dfdb

Please sign in to comment.