gradle-match-files-witouht-version-number.patch
1 | From df92ed786feeff0f54681d2f559ea25c9bbcef49 Mon Sep 17 00:00:00 2001 |
2 | From: Julien Lepiller <julien@lepiller.eu> |
3 | Date: Thu, 14 Dec 2017 19:26:57 +0100 |
4 | Subject: [PATCH] Also match files without version number. |
5 | |
6 | Guix usually build java libraries without embedding their version number |
7 | in the file name. This patch allows gradle to match these files too. |
8 | --- |
9 | .../org/gradle/api/internal/classpath/DefaultModuleRegistry.java | 9 ++++++--- |
10 | 1 file changed, 6 insertions(+), 3 deletions(-) |
11 | |
12 | diff --git a/subprojects/core/src/main/java/org/gradle/api/internal/classpath/DefaultModuleRegistry.java b/subprojects/core/src/main/java/org/gradle/api/internal/classpath/DefaultModuleRegistry.java |
13 | index bcd55e3..b0ffd2b 100644 |
14 | --- a/subprojects/core/src/main/java/org/gradle/api/internal/classpath/DefaultModuleRegistry.java |
15 | +++ b/subprojects/core/src/main/java/org/gradle/api/internal/classpath/DefaultModuleRegistry.java |
16 | @@ -227,18 +227,21 @@ public class DefaultModuleRegistry implements ModuleRegistry { |
17 | } |
18 | |
19 | private File findJar(String name) { |
20 | - Pattern pattern = Pattern.compile(Pattern.quote(name) + "-\\d.+\\.jar"); |
21 | + Pattern pattern = Pattern.compile(Pattern.quote(name) + "\\.jar"); |
22 | + Pattern pattern2 = Pattern.compile(Pattern.quote(name) + "-\\d.+\\.jar"); |
23 | if (gradleInstallation != null) { |
24 | for (File libDir : gradleInstallation.getLibDirs()) { |
25 | for (File file : libDir.listFiles()) { |
26 | - if (pattern.matcher(file.getName()).matches()) { |
27 | + if (pattern.matcher(file.getName()).matches() || |
28 | + pattern2.matcher(file.getName()).matches()) { |
29 | return file; |
30 | } |
31 | } |
32 | } |
33 | } |
34 | for (File file : classpath) { |
35 | - if (pattern.matcher(file.getName()).matches()) { |
36 | + if (pattern.matcher(file.getName()).matches() || |
37 | + pattern2.matcher(file.getName()).matches()) { |
38 | return file; |
39 | } |
40 | } |
41 | -- |
42 | 2.15.1 |
43 | |
44 |