Skip to content

Commit ca42707

Browse files
authored
Use a temporary repository location to download certain ecj versions ("drops") (#14703)
1 parent 86091d3 commit ca42707

File tree

2 files changed

+33
-28
lines changed

2 files changed

+33
-28
lines changed

gradle/libs.versions.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ assertj = "3.27.3"
88
commons-codec = "1.18.0"
99
# benchmark/ bzip2 compression
1010
commons-compress = "1.27.1"
11-
# @keep This version refers to ECJ batch compiler from p2 repositories ("drops").
12-
ecjP2Drop = "ecj-4.36M1"
11+
# See ecj-lint.gradle (used for more linting).
12+
ecj = "4.36M1"
1313
# java linting
1414
errorprone = "2.38.0"
1515
# markdown documentation generation
@@ -67,6 +67,7 @@ antlr-runtime = { module = "org.antlr:antlr4-runtime", version.ref = "antlr" }
6767
assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" }
6868
commons-codec = { module = "commons-codec:commons-codec", version.ref = "commons-codec" }
6969
commons-compress = { module = "org.apache.commons:commons-compress", version.ref = "commons-compress" }
70+
ecj = { module = "org.eclipse.jdt:ecj", version.ref = "ecj" }
7071
errorprone = { module = "com.google.errorprone:error_prone_core", version.ref = "errorprone" }
7172
flexmark-core = { module = "com.vladsch.flexmark:flexmark", version.ref = "flexmark" }
7273
flexmark-ext-abbreviation = { module = "com.vladsch.flexmark:flexmark-ext-abbreviation", version.ref = "flexmark" }

gradle/validation/ecj-lint.gradle

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,41 +17,45 @@
1717

1818
// This adds 'ecjLint' task.
1919

20-
configure(rootProject) {
21-
apply plugin: deps.plugins.undercouch.download.get().pluginId
22-
23-
def ecjVersion = deps.versions.ecjP2Drop.get()
24-
def ecjDropJar = project.layout.buildDirectory.file("ecj-drop/${ecjVersion}.jar")
25-
def downloadEcjDrop = tasks.register("downloadEcjDrop", Download, {
26-
src "https://www.eclipse.org/downloads/download.php?r=1&file=/eclipse/downloads/drops4/S-4.36M1-202504031800/${ecjVersion}.jar"
27-
dest project.layout.buildDirectory.dir("ecj-drop")
28-
overwrite false
29-
onlyIf {
30-
!ecjDropJar.get().asFile.exists()
31-
}
32-
})
33-
34-
configurations {
35-
ecjDropDeps
36-
}
37-
38-
artifacts {
39-
add("ecjDropDeps", ecjDropJar, {
40-
builtBy downloadEcjDrop
41-
})
42-
}
43-
}
44-
4520
def resources = scriptResources(buildscript)
4621

4722
allprojects {
4823
plugins.withType(JavaPlugin).configureEach {
24+
25+
// Use Lucene's storage space for "drop" versions that are ahead
26+
// of official Maven publications.
27+
//
28+
// Drop versions are at:
29+
// https://www.eclipse.org/downloads/download.php?r=1&file=/eclipse/downloads/drops4/S-4.36M1-202504031800/ecj-${ecjVersion}.jar
30+
boolean useDropMirror = deps.versions.ecj.get() in ["4.36M1"]
31+
if (useDropMirror) {
32+
repositories {
33+
exclusiveContent {
34+
forRepository {
35+
ivy {
36+
url = 'https://s3.amazonaws.com/lucene-testdata/temp-repo/ecj/'
37+
patternLayout {
38+
artifact "[artifact]-[revision](.[ext])"
39+
m2compatible = true
40+
}
41+
metadataSources {
42+
it.artifact()
43+
}
44+
}
45+
}
46+
filter {
47+
includeGroup "org.eclipse.jdt"
48+
}
49+
}
50+
}
51+
}
52+
4953
configurations {
5054
ecjDeps
5155
}
5256

5357
dependencies {
54-
ecjDeps project(path: ":", configuration: "ecjDropDeps")
58+
ecjDeps deps.ecj
5559
}
5660

5761
def ecjConfiguration = configurations.ecjDeps

0 commit comments

Comments
 (0)