Skip to content

Commit

Permalink
Bump Gradle from 6.5.1 to 7.5
Browse files Browse the repository at this point in the history
Fixes Gradle 7 deprecation warnings in the process
  • Loading branch information
chadlwilson committed Jul 31, 2022
1 parent 70ebfc7 commit 31d082d
Show file tree
Hide file tree
Showing 8 changed files with 202 additions and 153 deletions.
40 changes: 23 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ plugins {
}

group 'cd.go.plugin.config.yaml'
version "0.13.2"
version "0.13.3"

apply plugin: 'java'
apply plugin: "com.github.jk1.dependency-license-report"

project.ext {
pluginDesc = [
version:
project.version,
version: project.version,
goCdVersion: '20.4.0'
]

Expand All @@ -30,23 +29,24 @@ repositories {
}

dependencies {
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
compile group: 'commons-io', name: 'commons-io', version: '2.6'
compile group: 'org.apache.ant', name: 'ant', version: '1.10.7'
compile group: 'com.beust', name: 'jcommander', version: '1.78'
compile group: 'com.esotericsoftware.yamlbeans', name: 'yamlbeans', version: '1.13'
compile group: 'org.yaml', name: 'snakeyaml', version: '1.25'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.5'
implementation group: 'commons-io', name: 'commons-io', version: '2.6'
implementation group: 'org.apache.ant', name: 'ant', version: '1.10.7'
implementation group: 'com.beust', name: 'jcommander', version: '1.78'
implementation group: 'com.esotericsoftware.yamlbeans', name: 'yamlbeans', version: '1.13'
implementation group: 'org.yaml', name: 'snakeyaml', version: '1.25'

compileOnly group: 'cd.go.plugin', name: 'go-plugin-api', version: project.pluginApiVersion
testCompile group: 'cd.go.plugin', name: 'go-plugin-api', version: project.pluginApiVersion
testImplementation group: 'cd.go.plugin', name: 'go-plugin-api', version: project.pluginApiVersion

testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile group: 'org.mockito', name: 'mockito-core', version: '1.10.19'
testCompile group: 'org.hamcrest', name: 'hamcrest-core', version: '2.1'
testCompile group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1'
testImplementation group: 'junit', name: 'junit', version: '4.12'
testImplementation group: 'org.mockito', name: 'mockito-core', version: '1.10.19'
testImplementation group: 'org.hamcrest', name: 'hamcrest-core', version: '2.1'
testImplementation group: 'org.hamcrest', name: 'hamcrest-library', version: '2.1'
}

processResources {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
from("src/main/resource-templates") {
filesMatching('*') {
expand project.pluginDesc
Expand Down Expand Up @@ -75,10 +75,15 @@ sourceSets {
}

task copyTestResources(type: Copy) {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
from "${projectDir}/src/test/resources"
into "${buildDir}/classes/test"
}
processTestResources.dependsOn copyTestResources

processTestResources {
dependsOn copyTestResources
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}

test {
useJUnit {
Expand All @@ -90,9 +95,10 @@ test {

// create a fat jar with all dependencies
jar {
baseName = project.name
archiveBaseName = project.name
preserveFileTimestamps = false
reproducibleFileOrder = true
duplicatesStrategy = DuplicatesStrategy.INCLUDE

manifest {
attributes 'Main-Class': 'cd.go.plugin.config.yaml.cli.YamlPluginCli'
Expand All @@ -103,7 +109,7 @@ jar {
exclude "NOTICE.txt"
}

from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } }

exclude "META-INF/*.SF"
exclude "META-INF/*.DSA"
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ repositories {
}

dependencies {
compile group: 'com.github.jk1.dependency-license-report', name: 'com.github.jk1.dependency-license-report.gradle.plugin', version: '1.3'
implementation group: 'com.github.jk1.dependency-license-report', name: 'com.github.jk1.dependency-license-report.gradle.plugin', version: '2.0'
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package cd.go.plugin.buildsrc.license

import com.github.jk1.license.ProjectData
import com.github.jk1.license.render.ReportRenderer
import com.github.jk1.license.render.SingleInfoReportRenderer
import com.github.jk1.license.render.TextReportRenderer

class NoticeFileGenerator extends SingleInfoReportRenderer implements ReportRenderer {
class NoticeFileGenerator extends TextReportRenderer implements ReportRenderer {
ReportRenderer toDecorate
String licenseFolder

Expand All @@ -20,9 +20,9 @@ class NoticeFileGenerator extends SingleInfoReportRenderer implements ReportRend
projectData.allDependencies.collect { data ->
def noticeFile = new File(licenseFolder + 'NOTICE.txt')
if (!data.licenseFiles.empty) {
data.licenseFiles.first().files.collect { file ->
if (new File(file).name.toLowerCase().contains("notice")) {
noticeFile.append(new File(licenseFolder + file).getText('UTF-8'))
data.licenseFiles.first().fileDetails.collect { details ->
if (new File(details.file).name.toLowerCase().contains("notice")) {
noticeFile.append(new File(licenseFolder + details.file).getText('UTF-8'))
noticeFile.append('\n')
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package cd.go.plugin.buildsrc.license

import com.github.jk1.license.ProjectData
import com.github.jk1.license.render.ReportRenderer
import com.github.jk1.license.render.SingleInfoReportRenderer
import com.github.jk1.license.render.TextReportRenderer

class TeeRenderer extends SingleInfoReportRenderer implements ReportRenderer {
class TeeRenderer extends TextReportRenderer implements ReportRenderer {
ReportRenderer toDecorate
def LICENSES = [
'Apache License, Version 2.0',
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip
distributionSha256Sum=97a52d145762adc241bad7fd18289bf7f6801e08ece6badf80402fe2b9f250b1
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 31d082d

Please sign in to comment.