Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Add support for Gradle 8 #963

Merged
merged 1 commit into from
Aug 1, 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
41 changes: 24 additions & 17 deletions galasa-managers-parent/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,27 @@ subprojects {
}

// Define the artifact
def execFile = layout.buildDirectory.file('jacoco/jacocoMerge.exec')
def execArtifact = artifacts.add('archives', execFile.get().asFile) {
def mergedReportFile = layout.buildDirectory.file('reports/jacoco/jacocoMerge/jacocoMerge.xml')
def mergedReportArtifact = artifacts.add('archives', mergedReportFile.get().asFile) {
builtBy 'jacocoMerge'
}

task jacocoMerge(type: JacocoReport) {
gradle.projectsEvaluated {
// Get the jacocoTestReport tasks in all subprojects
def searchRecursively = true
def reportTasks = project.getTasksByName('jacocoTestReport', searchRecursively)
dependsOn reportTasks

task jacocoMerge(type: JacocoMerge) {
doFirst {
// go through all the files and remove the ones that do not exist. some managers do not have unit tests yet
executionData = executionData.filter({f -> f.exists()})
executionData.setFrom(executionData.filter({ it.exists() }))
sourceDirectories.setFrom(reportTasks.sourceDirectories)
classDirectories.setFrom(reportTasks.classDirectories)
}

enabled = jacocoEnabled.toBoolean()
reports {
html.required = true
xml.required = true
}
}

repositories {
Expand Down Expand Up @@ -86,7 +94,7 @@ if (jacocoEnabled.toBoolean()) {
publishing {
publications {
maven(MavenPublication) {
artifact execArtifact
artifact mergedReportArtifact

groupId = 'codecoverage'
artifactId = 'manager-unit-tests'
Expand All @@ -108,7 +116,7 @@ if (jacocoEnabled.toBoolean()) {
}


def manifestFilePath = "$buildDir/release.yaml"
def manifestFile = layout.buildDirectory.file("release.yaml").get().asFile

def header = """#
# Copyright contributors to the Galasa project
Expand Down Expand Up @@ -145,14 +153,13 @@ task buildReleaseYaml() {
if ( !buildDir.exists() ) {
buildDir.mkdirs()
}
def manifest_file = new File(manifestFilePath)
if (!manifest_file.exists()){
manifest_file.createNewFile()
if (!manifestFile.exists()){
manifestFile.createNewFile()
} else {
manifest_file.delete()
manifest_file.createNewFile()
manifestFile.delete()
manifestFile.createNewFile()
}
manifest_file.append(header)
manifestFile.append(header)
}


Expand All @@ -173,7 +180,7 @@ task buildReleaseYaml() {
doLast {
// Some projects don't have a version property... as they are parent projects mostly.
if (version != 'unspecified') {
def f = new File(manifestFilePath)
def f = manifestFile
f.append("\n\n - artifact: $projectName")
f.append("\n version: $version")
if (includeInOBR != '') {
Expand All @@ -200,7 +207,7 @@ task buildReleaseYaml() {
}
}

def myReleaseYaml = artifacts.add('release_metadata', file("$buildDir/release.yaml")) {
def myReleaseYaml = artifacts.add('release_metadata', manifestFile) {
builtBy 'buildReleaseYaml'
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,15 @@ test {
jacoco {
enabled = jacocoEnabled.toBoolean()
}
finalizedBy jacocoTestReport
}

jacocoTestReport {
enabled = jacocoEnabled.toBoolean()
dependsOn test

reports {
html.required = true
xml.required = true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,20 @@ plugins {

description = 'Galasa SDV Manager'

version = '0.34.0'
version = '0.36.0'

checkstyle {
configFile = file("config/checkstyle/checkstyle.xml")
toolVersion = "10.14.2"
}
configurations.all {
attributes {
attribute(Attribute.of('org.gradle.jvm.environment', String), 'standard-jvm')

// Apply a workaround to get checkstyle working with Gradle 6.x,
// this workaround is not required for later versions of Gradle.
if (project.getGradle().getGradleVersion().compareTo("7.0") < 0) {
configurations.all {
attributes {
attribute(Attribute.of('org.gradle.jvm.environment', String), 'standard-jvm')
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ managers:
codecoverage: false

- artifact: dev.galasa.sdv.manager
version: 0.34.0
version: 0.36.0
obr: true
mvp: true
bom: true
Expand Down