Skip to content

Commit

Permalink
#255 project access warnings fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
jk1 committed May 26, 2024
1 parent da8e2e1 commit 9c06e3b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ class CheckLicenseTask extends DefaultTask {

@TaskAction
void checkLicense() {
LOGGER.info("Startup CheckLicense for ${getProject().name}")
LOGGER.info("Startup CheckLicense for ${config.projects.first()}")
LicenseChecker licenseChecker = new LicenseChecker()
LOGGER.info("Check licenses if they are allowed to use.")
licenseChecker.checkAllDependencyLicensesAreAllowed(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import groovy.json.StringEscapeUtils
import org.gradle.testkit.runner.BuildResult
import org.gradle.testkit.runner.GradleRunner
import org.gradle.testkit.runner.TaskOutcome
import spock.lang.Ignore
import spock.lang.Specification
import spock.lang.TempDir

Expand Down Expand Up @@ -109,7 +110,7 @@ class CheckLicenseTaskSpec extends Specification {
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.8.21'
id 'com.github.jk1.dependency-license-report' version '2.1'
id 'com.github.jk1.dependency-license-report'
}
apply plugin: 'java'
Expand Down Expand Up @@ -184,7 +185,7 @@ class CheckLicenseTaskSpec extends Specification {
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.8.21'
id 'com.github.jk1.dependency-license-report' version '2.1'
id 'com.github.jk1.dependency-license-report'
}
apply plugin: 'java'
Expand Down Expand Up @@ -290,7 +291,7 @@ class CheckLicenseTaskSpec extends Specification {
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.8.21'
id 'com.github.jk1.dependency-license-report' version '2.1'
id 'com.github.jk1.dependency-license-report'
}
Expand Down Expand Up @@ -369,7 +370,7 @@ class CheckLicenseTaskSpec extends Specification {
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.8.21'
id 'com.github.jk1.dependency-license-report' version '2.1'
id 'com.github.jk1.dependency-license-report'
}
Expand Down Expand Up @@ -427,7 +428,7 @@ class CheckLicenseTaskSpec extends Specification {
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.8.21'
id 'com.github.jk1.dependency-license-report' version '2.1'
id 'com.github.jk1.dependency-license-report'
}
group 'greeting'
Expand Down Expand Up @@ -502,7 +503,7 @@ class CheckLicenseTaskSpec extends Specification {
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.8.21'
id 'com.github.jk1.dependency-license-report' version '2.1'
id 'com.github.jk1.dependency-license-report'
}
group 'greeting'
Expand Down Expand Up @@ -560,7 +561,7 @@ class CheckLicenseTaskSpec extends Specification {
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.8.21'
id 'com.github.jk1.dependency-license-report' version '2.1'
id 'com.github.jk1.dependency-license-report'
}
apply plugin: 'java'
Expand Down Expand Up @@ -623,7 +624,7 @@ class CheckLicenseTaskSpec extends Specification {
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.8.21'
id 'com.github.jk1.dependency-license-report' version '2.1'
id 'com.github.jk1.dependency-license-report'
}
apply plugin: 'java'
Expand Down Expand Up @@ -678,4 +679,23 @@ class CheckLicenseTaskSpec extends Specification {
then:
buildResult.task(":checkLicense").outcome == TaskOutcome.UP_TO_DATE
}

@Ignore // https://github.com/jk1/Gradle-License-Report/issues/255
def "using it with configuration cache should not cause the build to fail"() {
given:
buildFile << """
plugins {
id 'com.github.jk1.dependency-license-report'
}
licenseReport {
allowedLicensesFile = new File("${StringEscapeUtils.escapeJava(allowed.path)}")
}
"""
when:
BuildResult buildResult = result("--configuration-cache", "checkLicense")

then:
buildResult.task(":checkLicense").outcome == TaskOutcome.SUCCESS
}
}

0 comments on commit 9c06e3b

Please sign in to comment.