Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polishing pass after 2.0 -> 1.10 refactor #3152

Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Polishing new additions of build.gradle
jonatan-ivanov authored and shakuzen committed May 6, 2022
commit 56b2009de5b7ad492b71a70e90f79f27c9e04868
97 changes: 45 additions & 52 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -16,8 +16,8 @@ buildscript {
classpath 'io.spring.nohttp:nohttp-gradle:0.0.10'
classpath 'org.gradle:test-retry-gradle-plugin:1.3.1'
classpath 'io.github.gradle-nexus:publish-plugin:1.1.0'
classpath "me.champeau.gradle:japicmp-gradle-plugin:0.4.0"
classpath "de.undercouch:gradle-download-task:5.0.2"
classpath 'me.champeau.gradle:japicmp-gradle-plugin:0.4.0'
classpath 'de.undercouch:gradle-download-task:5.0.2'
classpath 'io.spring.javaformat:spring-javaformat-gradle-plugin:0.0.31'

constraints {
@@ -296,55 +296,55 @@ subprojects {
}
}


// new projects
if (["micrometer-commons", "micrometer-observation", "micrometer-observation-test"].every { it != project.name }) {
if (!(project.name in ['micrometer-commons', 'micrometer-observation', 'micrometer-observation-test'])) {
apply plugin: 'me.champeau.gradle.japicmp'
apply plugin: 'de.undercouch.download'

task downloadBaseline(type: Download) {
onlyIf {
if (project.gradle.startParameter.isOffline()) {
println "Offline: skipping downloading of baseline and JAPICMP"
return false
} else if ("$compatibleVersion" == "SKIP") {
println "SKIP: Instructed to skip the baseline comparison"
return false
task downloadBaseline(type: Download) {
onlyIf {
if (project.gradle.startParameter.isOffline()) {
println 'Offline: skipping downloading of baseline and JAPICMP'
return false
} else if (compatibleVersion == 'SKIP') {
println 'SKIP: Instructed to skip the baseline comparison'
return false
} else {
println "Will download and perform baseline comparison with ${compatibleVersion}"
return true
}
}

onlyIfNewer true
compress true
String rootUrl
if (compatibleVersion.contains('-M') || compatibleVersion.contains('-RC')) {
rootUrl = 'https://repo.spring.io/milestone/'
} else if (compatibleVersion.contains('-SNAPSHOT') ) {
rootUrl = 'https://repo.spring.io/snapshot/'
} else {
println "Will download and perform baseline comparison with ${compatibleVersion}"
return true
rootUrl = repositories.mavenCentral().url
}
}

onlyIfNewer true
compress true
String rootUrl = repositories.mavenCentral().url
if (compatibleVersion.contains("-M") || compatibleVersion.contains("-RC")) {
rootUrl = "https://repo.spring.io/milestone/"
} else {
rootUrl = "https://repo.spring.io/snapshot/"
src "${rootUrl}io/micrometer/${project.name}/${compatibleVersion}/${project.name}-${compatibleVersion}.jar"
dest "${buildDir}/baselineLibs/${project.name}-${compatibleVersion}.jar"
}
src "${rootUrl}io/micrometer/${project.name}/${compatibleVersion}/${project.name}-${compatibleVersion}.jar"
dest "${buildDir}/baselineLibs/${project.name}-${compatibleVersion}.jar"
}

task japicmp(type: me.champeau.gradle.japicmp.JapicmpTask) {
oldClasspath.from(files("${buildDir}/baselineLibs/${project.name}-${compatibleVersion}.jar"))
newClasspath.from(files(jar.archiveFile, project(":${project.name}").jar))
onlyBinaryIncompatibleModified = true
// TODO: Turn this to true once 1.9.0 is out
failOnModification = false
failOnSourceIncompatibility = true
txtOutputFile = file("${project.buildDir}/reports/japi.txt")
ignoreMissingClasses = true
includeSynthetic = true
onlyIf { "${compatibleVersion}" != "SKIP" }
}
task japicmp(type: me.champeau.gradle.japicmp.JapicmpTask) {
oldClasspath.from(files("${buildDir}/baselineLibs/${project.name}-${compatibleVersion}.jar"))
newClasspath.from(files(jar.archiveFile, project(":${project.name}").jar))
onlyBinaryIncompatibleModified = true
// TODO: Turn this to true once 1.9.0 is out
failOnModification = false
failOnSourceIncompatibility = true
txtOutputFile = file("${project.buildDir}/reports/japi.txt")
ignoreMissingClasses = true
includeSynthetic = true
onlyIf { compatibleVersion != 'SKIP' }
}

tasks.japicmp.dependsOn(downloadBaseline)
tasks.check.dependsOn(japicmp)
tasks.japicmp.dependsOn(downloadBaseline)
tasks.check.dependsOn(japicmp)
}

}

contacts {
@@ -358,21 +358,14 @@ subprojects {
description = 'Application monitoring instrumentation facade'

repositories {
mavenLocal()
mavenCentral()
maven {
url 'https://repo.spring.io/snapshot/'
content {
// we only need this repo for the context-propagation-api
includeModule 'io.micrometer', 'context-propagation-api'
}
url 'https://repo.spring.io/snapshot/' // we only need this repo for the context-propagation-api
content { includeModule 'io.micrometer', 'context-propagation-api' }
}
maven {
url 'https://repo.spring.io/milestone/'
content {
// we only need this repo for the context-propagation-api
includeModule 'io.micrometer', 'context-propagation-api'
}
url 'https://repo.spring.io/milestone/' // we only need this repo for the context-propagation-api
content { includeModule 'io.micrometer', 'context-propagation-api' }
}
}