| @@ -39,7 +39,7 test { | |||||
| 39 | publishing { |
|
39 | publishing { | |
| 40 | repositories { |
|
40 | repositories { | |
| 41 | ivy { |
|
41 | ivy { | |
| 42 | url "${System.properties["user.home"]}/ivy-repo" |
|
42 | url = "${System.properties["user.home"]}/ivy-repo" | |
| 43 | } |
|
43 | } | |
| 44 | } |
|
44 | } | |
| 45 | publications { |
|
45 | publications { | |
| 1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
| @@ -1,6 +1,6 | |||||
| 1 | distributionBase=GRADLE_USER_HOME |
|
1 | distributionBase=GRADLE_USER_HOME | |
| 2 | distributionPath=wrapper/dists |
|
2 | distributionPath=wrapper/dists | |
| 3 |
distributionUrl=https\://services.gradle.org/distributions/gradle- |
|
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip | |
| 4 | networkTimeout=10000 |
|
4 | networkTimeout=10000 | |
| 5 | validateDistributionUrl=true |
|
5 | validateDistributionUrl=true | |
| 6 | zipStoreBase=GRADLE_USER_HOME |
|
6 | zipStoreBase=GRADLE_USER_HOME | |
| @@ -15,6 +15,8 | |||||
| 15 | # See the License for the specific language governing permissions and |
|
15 | # See the License for the specific language governing permissions and | |
| 16 | # limitations under the License. |
|
16 | # limitations under the License. | |
| 17 | # |
|
17 | # | |
|
|
18 | # SPDX-License-Identifier: Apache-2.0 | |||
|
|
19 | # | |||
| 18 |
|
20 | |||
| 19 | ############################################################################## |
|
21 | ############################################################################## | |
| 20 | # |
|
22 | # | |
| @@ -55,7 +57,7 | |||||
| 55 | # Darwin, MinGW, and NonStop. |
|
57 | # Darwin, MinGW, and NonStop. | |
| 56 | # |
|
58 | # | |
| 57 | # (3) This script is generated from the Groovy template |
|
59 | # (3) This script is generated from the Groovy template | |
| 58 |
# https://github.com/gradle/gradle/blob/HEAD/ |
|
60 | # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt | |
| 59 | # within the Gradle project. |
|
61 | # within the Gradle project. | |
| 60 | # |
|
62 | # | |
| 61 | # You can find Gradle at https://github.com/gradle/gradle/. |
|
63 | # You can find Gradle at https://github.com/gradle/gradle/. | |
| @@ -84,7 +86,8 done | |||||
| 84 | # shellcheck disable=SC2034 |
|
86 | # shellcheck disable=SC2034 | |
| 85 | APP_BASE_NAME=${0##*/} |
|
87 | APP_BASE_NAME=${0##*/} | |
| 86 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) |
|
88 | # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) | |
| 87 |
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && p |
|
89 | APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s | |
|
|
90 | ' "$PWD" ) || exit | |||
| 88 |
|
91 | |||
| 89 | # Use the maximum available, or set MAX_FD != -1 to use that value. |
|
92 | # Use the maximum available, or set MAX_FD != -1 to use that value. | |
| 90 | MAX_FD=maximum |
|
93 | MAX_FD=maximum | |
| @@ -13,6 +13,8 | |||||
| 13 | @rem See the License for the specific language governing permissions and |
|
13 | @rem See the License for the specific language governing permissions and | |
| 14 | @rem limitations under the License. |
|
14 | @rem limitations under the License. | |
| 15 | @rem |
|
15 | @rem | |
|
|
16 | @rem SPDX-License-Identifier: Apache-2.0 | |||
|
|
17 | @rem | |||
| 16 |
|
18 | |||
| 17 | @if "%DEBUG%"=="" @echo off |
|
19 | @if "%DEBUG%"=="" @echo off | |
| 18 | @rem ########################################################################## |
|
20 | @rem ########################################################################## | |
| @@ -13,7 +13,7 dependencyResolutionManagement { | |||||
| 13 | mavenCentral() |
|
13 | mavenCentral() | |
| 14 | mavenLocal() |
|
14 | mavenLocal() | |
| 15 | ivy { |
|
15 | ivy { | |
| 16 | url "${System.properties["user.home"]}/ivy-repo" |
|
16 | url = "${System.properties["user.home"]}/ivy-repo" | |
| 17 | } |
|
17 | } | |
| 18 | } |
|
18 | } | |
| 19 | } |
|
19 | } | |
| @@ -43,7 +43,7 javadoc { | |||||
| 43 | publishing { |
|
43 | publishing { | |
| 44 | repositories { |
|
44 | repositories { | |
| 45 | ivy { |
|
45 | ivy { | |
| 46 | url "${System.properties["user.home"]}/ivy-repo" |
|
46 | url = "${System.properties["user.home"]}/ivy-repo" | |
| 47 | } |
|
47 | } | |
| 48 | } |
|
48 | } | |
| 49 | publications { |
|
49 | publications { | |
| @@ -9,6 +9,7 import java.nio.file.Path; | |||||
| 9 | import java.util.LinkedHashSet; |
|
9 | import java.util.LinkedHashSet; | |
| 10 | import java.util.List; |
|
10 | import java.util.List; | |
| 11 | import java.util.stream.Collectors; |
|
11 | import java.util.stream.Collectors; | |
|
|
12 | import java.util.regex.Pattern; | |||
| 12 |
|
13 | |||
| 13 | import org.gradle.testkit.runner.GradleRunner; |
|
14 | import org.gradle.testkit.runner.GradleRunner; | |
| 14 | import org.gradle.testkit.runner.UnexpectedBuildFailure; |
|
15 | import org.gradle.testkit.runner.UnexpectedBuildFailure; | |
| @@ -19,6 +20,8 import org.junit.jupiter.api.io.TempDir; | |||||
| 19 | abstract class AbstractFunctionalTest { |
|
20 | abstract class AbstractFunctionalTest { | |
| 20 | private static final String SETTINGS_FILE = "settings.gradle"; |
|
21 | private static final String SETTINGS_FILE = "settings.gradle"; | |
| 21 | private static final String BUILD_FILE = "build.gradle"; |
|
22 | private static final String BUILD_FILE = "build.gradle"; | |
|
|
23 | private static final Pattern INCLUDE_DECLARATION = Pattern.compile("^include(?:\\s|\\().*"); | |||
|
|
24 | private static final Pattern QUOTED_LITERAL = Pattern.compile("['\"]([^'\"]+)['\"]"); | |||
| 22 |
|
25 | |||
| 23 | @TempDir |
|
26 | @TempDir | |
| 24 | Path testProjectDir; |
|
27 | Path testProjectDir; | |
| @@ -94,5 +97,27 abstract class AbstractFunctionalTest { | |||||
| 94 | Path path = testProjectDir.resolve(relativePath); |
|
97 | Path path = testProjectDir.resolve(relativePath); | |
| 95 | Files.createDirectories(path.getParent()); |
|
98 | Files.createDirectories(path.getParent()); | |
| 96 | Files.writeString(path, content); |
|
99 | Files.writeString(path, content); | |
|
|
100 | ||||
|
|
101 | if (SETTINGS_FILE.equals(relativePath)) | |||
|
|
102 | ensureIncludedProjectDirectories(content); | |||
|
|
103 | } | |||
|
|
104 | ||||
|
|
105 | private void ensureIncludedProjectDirectories(String settingsContent) throws IOException { | |||
|
|
106 | for (var line : settingsContent.split("\\R")) { | |||
|
|
107 | var trimmed = line.strip(); | |||
|
|
108 | if (!INCLUDE_DECLARATION.matcher(trimmed).matches()) | |||
|
|
109 | continue; | |||
|
|
110 | ||||
|
|
111 | var matcher = QUOTED_LITERAL.matcher(trimmed); | |||
|
|
112 | while (matcher.find()) { | |||
|
|
113 | var projectPath = matcher.group(1); | |||
|
|
114 | if (projectPath.startsWith(":")) | |||
|
|
115 | projectPath = projectPath.substring(1); | |||
|
|
116 | if (projectPath.isBlank()) | |||
|
|
117 | continue; | |||
|
|
118 | ||||
|
|
119 | Files.createDirectories(testProjectDir.resolve(projectPath.replace(':', File.separatorChar))); | |||
| 97 | } |
|
120 | } | |
| 98 | } |
|
121 | } | |
|
|
122 | } | |||
|
|
123 | } | |||
| @@ -103,9 +103,7 class VariantArtifactsPluginFunctionalTe | |||||
| 103 | } |
|
103 | } | |
| 104 |
|
104 | |||
| 105 | @Test |
|
105 | @Test | |
| 106 |
void gradleReferenceRegisteredSecondaryArtifactVariant |
|
106 | void gradleReferenceRegisteredSecondaryArtifactVariantAllowsSecondaryArtifactSelection() throws Exception { | |
| 107 | // Gradle issue: https://github.com/gradle/gradle/issues/27441 |
|
|||
| 108 | // Registered outgoing artifact variants are not realized before dependency resolution. |
|
|||
| 109 | writeFile("settings.gradle", """ |
|
107 | writeFile("settings.gradle", """ | |
| 110 | rootProject.name = 'gradle-reference-registered-secondary-variant' |
|
108 | rootProject.name = 'gradle-reference-registered-secondary-variant' | |
| 111 | include 'producer', 'consumer' |
|
109 | include 'producer', 'consumer' | |
| @@ -166,8 +164,10 class VariantArtifactsPluginFunctionalTe | |||||
| 166 | } |
|
164 | } | |
| 167 | """); |
|
165 | """); | |
| 168 |
|
166 | |||
| 169 | assertBuildFails("Cannot create variant 'js' after dependency configuration ':producer:browserElements' has been resolved", |
|
167 | BuildResult result = runner(":consumer:probe").build(); | |
| 170 | ":consumer:probe"); |
|
168 | ||
|
|
169 | assertTrue(result.getOutput().contains("compileFiles=typesPackage")); | |||
|
|
170 | assertTrue(result.getOutput().contains("jsFiles=js")); | |||
| 171 | } |
|
171 | } | |
| 172 |
|
172 | |||
| 173 | @Test |
|
173 | @Test | |
General Comments 0
You need to be logged in to leave comments.
Login now
