File tree Expand file tree Collapse file tree 2 files changed +11
-15
lines changed Expand file tree Collapse file tree 2 files changed +11
-15
lines changed Original file line number Diff line number Diff line change 202202 depNameTemplate : 'java' ,
203203 extractVersionTemplate : '^(?<version>\\d+)' ,
204204 } ,
205+ {
206+ customType : 'regex' ,
207+ datasourceTemplate : 'github-releases' ,
208+ managerFilePatterns : [
209+ '**/build.gradle.kts' ,
210+ ] ,
211+ matchStrings : [
212+ '"https://github.com/(?<depName>[^/]+/[^/]+)/zipball/(?<currentValue>.+?)"' ,
213+ ] ,
214+ } ,
205215 ] ,
206216}
Original file line number Diff line number Diff line change 11import de.undercouch.gradle.tasks.download.DownloadExtension
2- import java.net.HttpURLConnection
3- import java.net.URL
42
53plugins {
64 id(" otel.java-conventions" )
@@ -53,19 +51,7 @@ abstract class DownloadOpampProtos @Inject constructor(
5351
5452 @TaskAction
5553 fun execute () {
56- // Get the latest release tag by following the redirect from GitHub's latest release URL
57- val latestReleaseUrl = " https://github.com/open-telemetry/opamp-spec/releases/latest"
58- val connection = URL (latestReleaseUrl).openConnection() as HttpURLConnection
59- connection.instanceFollowRedirects = false
60- connection.requestMethod = " HEAD"
61-
62- val redirectLocation = connection.getHeaderField(" Location" )
63- connection.disconnect()
64-
65- // Extract tag from URL like: https://github.com/open-telemetry/opamp-spec/releases/tag/v0.12.0
66- val latestTag = redirectLocation.substringAfterLast(" /" )
67- // Download the source code for the latest release
68- val zipUrl = " https://github.com/open-telemetry/opamp-spec/zipball/$latestTag "
54+ val zipUrl = " https://github.com/open-telemetry/opamp-spec/zipball/v0.14.0"
6955
7056 download.run {
7157 src(zipUrl)
You can’t perform that action at this time.
0 commit comments