From b96913e24eaaae6f1161743072f5bc9442ed7dba Mon Sep 17 00:00:00 2001 From: Yurii Serhiichuk Date: Sun, 3 Mar 2024 16:19:56 +0100 Subject: [PATCH] Migrate from deprecated and outdated APIs --- bintray.gradle | 8 ++++---- build.gradle | 31 +++++++++++++++---------------- website.gradle | 17 ++++++++++------- 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/bintray.gradle b/bintray.gradle index 8f3baff3..219d3cf0 100644 --- a/bintray.gradle +++ b/bintray.gradle @@ -22,13 +22,13 @@ def pomConfig = { } } -task javadocJar(type: Jar) { - classifier = 'javadoc' +tasks.register('javadocJar', Jar) { + getArchiveClassifier().set("javadoc") from javadoc } -task sourcesJar(type: Jar) { - classifier = 'sources' +tasks.register('sourcesJar', Jar) { + getArchiveClassifier().set("sources") from sourceSets.main.allSource } diff --git a/build.gradle b/build.gradle index 6ad763b6..47e6f156 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ buildscript { repositories { - jcenter() + mavenCentral() } dependencies { classpath 'biz.aQute.bnd:biz.aQute.bnd.gradle:4.3.1' @@ -37,7 +37,7 @@ checkstyle { // maxWarnings = 0 } -tasks.withType(Checkstyle) { +tasks.withType(Checkstyle).configureEach { reports { xml.enabled true // html.destination rootProject.file("build/reports/checkstyle.html") @@ -47,7 +47,7 @@ tasks.withType(Checkstyle) { jacoco { toolVersion = "0.8.5" - reportsDir = file("${buildDir}/jacocoHtml") + getReportsDirectory().set(file("${buildDir}/jacocoHtml")) } jacocoTestReport { @@ -90,7 +90,7 @@ group = 'name.neuhalfen.projects.crypto.bouncycastle.openpgp' version = '2.3.0' repositories { - jcenter() + mavenCentral() } sourceSets { @@ -111,7 +111,7 @@ configurations { integrationTestRuntime.extendsFrom testRuntime } -task integrationTest(type: Test) { +tasks.register('integrationTest', Test) { description = 'Runs the integration tests.' group = LifecycleBasePlugin.VERIFICATION_GROUP testClassesDirs = sourceSets.integrationTest.output.classesDirs @@ -123,20 +123,19 @@ check.dependsOn integrationTest dependencies { - compile 'org.bouncycastle:bcprov-jdk15on:1.67' - compile 'org.bouncycastle:bcpg-jdk15on:1.67' + implementation 'org.bouncycastle:bcprov-jdk15on:1.67' + implementation 'org.bouncycastle:bcpg-jdk15on:1.67' - compile 'org.slf4j:slf4j-api:1.7.30' + implementation 'org.slf4j:slf4j-api:1.7.30' // @Nullable and friends are not needed at runtime - compile 'com.google.code.findbugs:jsr305:3.0.2' - - testCompile 'junit:junit:4.13' - testCompile 'org.hamcrest:hamcrest-all:1.3' - testCompile 'org.mockito:mockito-core:3.2.4' - testCompile 'org.concordion:concordion-api-documentation-extension:0.0.4' - testCompile 'ch.qos.logback:logback-classic:1.2.3' + implementation 'com.google.code.findbugs:jsr305:3.0.2' + testImplementation 'junit:junit:4.13' + testImplementation 'org.hamcrest:hamcrest-all:1.3' + testImplementation 'org.mockito:mockito-core:3.2.4' + testImplementation 'org.concordion:concordion-api-documentation-extension:0.0.4' + testImplementation 'ch.qos.logback:logback-classic:1.2.3' } @@ -164,7 +163,7 @@ if (hasProperty('bintray_Username')) { apply from: 'website.gradle' wrapper { - gradleVersion = '6.5' + gradleVersion = '6.9.4' } // Generate OSGI bundle metadata diff --git a/website.gradle b/website.gradle index 1642b6b7..0c73310a 100644 --- a/website.gradle +++ b/website.gradle @@ -4,7 +4,8 @@ import name.neuhalfen.concordion.transform.ConcordionHtmlToMarkdownTransformer // https://github.com/ajoberstar/gradle-git-publish -task prepareSpecsForCMS(type: Copy, dependsOn: ['prepareCmsBuildRoot', 'test']) { +tasks.register('prepareSpecsForCMS', Copy) { + setDependsOn(['prepareCmsBuildRoot', 'test']) description 'Transform the build output of concordion to include it in the CMS' from(fileTree("${specifications_prepareForCms_source}")) { @@ -16,24 +17,26 @@ task prepareSpecsForCMS(type: Copy, dependsOn: ['prepareCmsBuildRoot', 'test']) filter(ConcordionHtmlToMarkdownTransformer) } -task removeOldCMSBuild(type: Delete) { +tasks.register('removeOldCMSBuild', Delete) { delete "${specifications_cms_target}" delete "${cms_BuildRoot}" } -task prepareCmsBuildRoot(type: Copy, dependsOn: ['removeOldCMSBuild']) { +tasks.register('prepareCmsBuildRoot', Copy) { + dependsOn['removeOldCMSBuild'] from("${specifications_cms_cmsdRoot}") into "${cms_BuildRoot}" } - -task generateWebsite(type: Exec, dependsOn: ['prepareSpecsForCMS']) { +tasks.register('generateWebsite', Exec) { + dependsOn['prepareSpecsForCMS'] commandLine = [hugo, '--cleanDestinationDir', '--destination', "${specifications_cms_target}", '--enableGitInfo'] workingDir = file("${cms_BuildRoot}") } -task previewWebsite(type: Exec, dependsOn: ['generateWebsite']) { +tasks.register('previewWebsite', Exec) { + dependsOn['generateWebsite'] commandLine = [hugo, 'server', '--debug', '--watch', '--enableGitInfo'] workingDir = file("${cms_BuildRoot}") } @@ -62,4 +65,4 @@ gitPublish { commitMessage = 'Publishing github pages' // defaults to 'Generated by gradle-git-publish' } -task publishWebsite(dependsOn: ['generateWebsite', 'gitPublishPush']) +tasks.register('publishWebsite') { setDependsOn(['generateWebsite', 'gitPublishPush']) }