File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
grace-shell/src/main/groovy/org/grails/cli/profile/commands Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -1062,7 +1062,7 @@ class CreateAppCommand extends ArgumentCompletingCommand implements ProfileRepos
10621062 List<GradleDependency > gradleDependencies = convertToGradleDependencies(dependencies, grailsVersion)
10631063
10641064 String dependenciesString = gradleDependencies
1065- .sort({ GradleDependency dep -> dep . scope })
1065+ .sort({ GradleDependency dep1 , GradleDependency dep2 -> dep1 <=> dep2 })
10661066 .collect({ GradleDependency dep -> dep. toString(4 ) })
10671067 .unique()
10681068 .join(ln)
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2017-2024 the original author or authors.
2+ * Copyright 2017-2025 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@ package org.grails.cli.profile.commands.io
1818import org.eclipse.aether.artifact.Artifact
1919import org.eclipse.aether.graph.Dependency
2020
21- class GradleDependency {
21+ class GradleDependency implements Comparable< GradleDependency > {
2222
2323 static final Map<String , String > SCOPE_MAP = [
2424 console : ' console' ,
@@ -92,4 +92,14 @@ class GradleDependency {
9292 scope
9393 }
9494
95+ String getDependency () {
96+ dependency
97+ }
98+
99+ @Override
100+ int compareTo (GradleDependency d ) {
101+ int s = this . scope <=> d. scope
102+ (s == 0 ) ? this . dependency <=> d. dependency : s
103+ }
104+
95105}
You can’t perform that action at this time.
0 commit comments