-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Update build to Gradle 7.0 #68506
Update build to Gradle 7.0 #68506
Conversation
7a76725
to
b3b8b6a
Compare
a976292
to
4c52e0d
Compare
2b90ae0
to
d147f9d
Compare
currently blocked by gradle/gradle#15566 |
7856bff
to
c2416a4
Compare
currently blocked by nebula-plugins/gradle-ospackage-plugin#393 |
01720b6
to
72e31ac
Compare
7361550
to
16bd490
Compare
@elasticmachine test this please |
432c16e
to
726bda6
Compare
726bda6
to
46a92dd
Compare
2281583
to
e9b7574
Compare
@@ -283,7 +283,7 @@ allprojects { | |||
} | |||
} | |||
boolean hasShadow = project.plugins.hasPlugin(ShadowPlugin) | |||
project.configurations.compile.dependencies |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
deprecated compile
has been removed.
This should have been replaced before but now ultimately caused the build to fail
@@ -30,13 +30,13 @@ class SnippetsTask extends DefaultTask { | |||
private static final String SCHAR = /(?:\\\/|[^\/])/ | |||
private static final String SUBSTITUTION = /s\/($SCHAR+)\/($SCHAR*)\// | |||
private static final String CATCH = /catch:\s*((?:\/[^\/]+\/)|[^ \]]+)/ | |||
private static final String SKIP = /skip:([^\]]+)/ | |||
private static final String SKIP_REGEX = /skip:([^\]]+)/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$SKIP seems like a reserved term in Groovy 3.0 and caused trouble here. Therefore the renaming
@@ -37,20 +36,6 @@ public void apply(Project project) { | |||
* Adds repositories used by ES projects and dependencies | |||
*/ | |||
public static void configureRepositories(Project project) { | |||
// ensure all repositories use secure urls | |||
// TODO: remove this with gradle 7.0, which no longer allows insecure urls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolving this TODO by removing the extra logic for http checks
@@ -38,14 +43,19 @@ public void apply(Project project) { | |||
t.copy("test/ssl/test-node.jks"); | |||
t.setOutputDir(keyStoreDir); | |||
}); | |||
|
|||
project.getPlugins() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make implicit dependencies explicit
@@ -55,6 +56,13 @@ public void prepare() { | |||
task = createDependencyLicensesTask(project); | |||
updateShas = createUpdateShasTask(project, task); | |||
dependency = project.getDependencies().localGroovy(); | |||
task.configure(new Action<DependencyLicensesTask>() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Groovy is shipped with different artefacts now
@@ -163,7 +163,7 @@ subprojects { | |||
java { | |||
// Normally this isn't necessary, but we have Java sources in | |||
// non-standard places | |||
target '**/*.java' | |||
target 'src/**/*.java' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
narrow down the tasks inputs here to avoid implicit dependencies on others tasks output we do not want here (and is deprecated with gradle 7.0)
@@ -68,7 +68,9 @@ dependencies { | |||
// Set the keytab files in the classpath so that we can access them from test code without the security manager | |||
// freaking out. | |||
if (isEclipse == false) { | |||
testRuntimeOnly files(project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs", "hdfs_hdfs.build.elastic.co.keytab").parent) | |||
testRuntimeOnly files(project(':test:fixtures:krb5kdc-fixture').ext.krb5Keytabs("hdfs", "hdfs_hdfs.build.elastic.co.keytab").parent) { | |||
builtBy ":test:fixtures:krb5kdc-fixture:preProcessFixture" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make task dependency explicit
@@ -80,7 +80,7 @@ artifacts { | |||
|
|||
tasks.register("extractNativeLicenses", Copy) { | |||
dependsOn configurations.nativeBundle | |||
into "${buildDir}" | |||
into "${buildDir}/extractedNativeLicenses" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use a dedicated output folder for extracted native licenses. This avoids not having the whole buildDir
considered a task output here
Pinging @elastic/es-delivery (Team:Delivery) |
@elasticmachine run elasticsearch-ci/2 |
I'll look into elasticsearch-hadoop build first before merging this to ensure elasticsearch-hadoop is ready to be updated to 7.0 too |
Elastic-hadoop PR has been created here: elastic/elasticsearch-hadoop#1641 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woohoo! LGTM.
maven { url 'https://jitpack.io' } | ||
} | ||
dependencies { | ||
classpath "com.github.breskeby:gradle-ospackage-plugin:ddb72a9922b934033827d48d296f7f3d470ac422" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need to fork this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm waiting for a release of the ospackage plugin that includes my PR that fixed a stackoverflow within the plugin: nebula-plugins/gradle-ospackage-plugin#397
- Update gradle wrapper to gradle 7.0 - Remove deprecated usages to make build 7.0 compatible - Fix excludes in docs snippet tasks (See gradle/gradle#16160 for details) - Fix deprecation warnings in 7.0 - Add explicit dependencies that have been missed - Make extract native licenses tasks output dir more explicit - Use a snapshot of the ospackage plugin that includes a fix for 7.0 already - fix test runtime classpath setup in repository-hdfs - Make task dependency explicit to fix further deprecation warnings - Remove manual check for http repo usages that has been deprecated in gradle 7.0 - Update spock to latest 2.0 milestone required for groovy 3
- Update gradle wrapper to gradle 7.0 - Remove deprecated usages to make build 7.0 compatible - Fix excludes in docs snippet tasks (See gradle/gradle#16160 for details) - Fix deprecation warnings in 7.0 - Add explicit dependencies that have been missed - Make extract native licenses tasks output dir more explicit - Use a snapshot of the ospackage plugin that includes a fix for 7.0 already - fix test runtime classpath setup in repository-hdfs - Make task dependency explicit to fix further deprecation warnings - Remove manual check for http repo usages that has been deprecated in gradle 7.0 - Update spock to latest 2.0 milestone required for groovy 3
- Update gradle wrapper to gradle 7.0 - Remove deprecated usages to make build 7.0 compatible - Fix excludes in docs snippet tasks (See gradle/gradle#16160 for details) - Fix deprecation warnings in 7.0 - Add explicit dependencies that have been missed - Make extract native licenses tasks output dir more explicit - Use a snapshot of the ospackage plugin that includes a fix for 7.0 already - fix test runtime classpath setup in repository-hdfs - Make task dependency explicit to fix further deprecation warnings - Remove manual check for http repo usages that has been deprecated in gradle 7.0 - Update spock to latest 2.0 milestone required for groovy 3 - Disable module inference in Eclipse (#71649) We recently upgrade to gradle 7.0 (#69096) which turned on module inference by default. I'm sure that's lovely, but its broken eclipse. We should probably support modules one day, but that day ain't today. This turns off module inference for eclipse so it can continue compiling things just like it did yesterday. Co-authored-by: Nik Everett <nik9000@gmail.com>
Gradle 7.0 GA has been released. We want to stay on the latest released Gradle version for our elasticsearch builds.
This updates our build to use Gradle 7.0 and applies some required changes to make our build compatible with the latest Gradle version.
Most of the heavy lifting to support 7.0 have been merged into master already in earlier separated PRs.
As this is a bigger change I also triggered a few other CI builds to get more reassurance than usual: