From b48cac0206fa4cdb8597cd1b3d72892bf8432e6b Mon Sep 17 00:00:00 2001 From: Dawid Weiss Date: Fri, 17 Dec 2021 19:12:09 +0100 Subject: [PATCH] LUCENE-10285: try to force ordering of internal tasks, in spite of making top-level wrapper dependencies. (#549) --- gradle/generation/jflex.gradle | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/gradle/generation/jflex.gradle b/gradle/generation/jflex.gradle index dc886bd18d6..c533c3cfa4f 100644 --- a/gradle/generation/jflex.gradle +++ b/gradle/generation/jflex.gradle @@ -150,11 +150,15 @@ configure(project(":lucene:analysis:common")) { } def generateUAX29URLEmailTokenizer = wrapWithPersistentChecksums(generateUAX29URLEmailTokenizerInternal, [ andThenTasks: ["spotlessJava", "spotlessJavaApply"] ]) + // UAX29URLEmailTokenizerImpl.jflex includes: ASCIITLD.jflex + // so we make sure it is up to date. Also, make sure the ordering of internal + // tasks is enforced (just scheduling top-level wrappers doesn't mean their subtask graphs cannot be reordered). configure (generateUAX29URLEmailTokenizer) { - // UAX29URLEmailTokenizerImpl.jflex includes: ASCIITLD.jflex - // so we make sure it is up to date. dependsOn "generateTlds" } + configure (generateUAX29URLEmailTokenizerInternal) { + mustRunAfter "generateTldsInternal" + } task generateHTMLCharacterEntitiesInternal() { def target = file('src/java/org/apache/lucene/analysis/charfilter/HTMLCharacterEntities.jflex') @@ -194,10 +198,13 @@ configure(project(":lucene:analysis:common")) { } def generateHTMLStripCharFilter = wrapWithPersistentChecksums(generateHTMLStripCharFilterInternal, [ andThenTasks: ["spotlessJava", "spotlessJavaApply"] ]) + // HTMLStripCharFilter.jflex includes HTMLCharacterEntities.jflex so we make sure it's up to date. configure(generateHTMLStripCharFilter) { - // HTMLStripCharFilter.jflex includes HTMLCharacterEntities.jflex so we make sure it's up to date. dependsOn "generateHTMLCharacterEntities" } + configure(generateHTMLStripCharFilterInternal) { + dependsOn "generateHTMLCharacterEntitiesInternal" + } regenerate.dependsOn wrapWithPersistentChecksums(generateWikipediaTokenizerInternal, [ andThenTasks: ["spotlessJava", "spotlessJavaApply"] ]), wrapWithPersistentChecksums(generateClassicTokenizerInternal, [ andThenTasks: ["spotlessJava", "spotlessJavaApply"] ]),