File tree Expand file tree Collapse file tree 5 files changed +26
-5
lines changed
main/java/org/scm4j/commons/coords
test/java/org/scm4j/commons Expand file tree Collapse file tree 5 files changed +26
-5
lines changed Original file line number Diff line number Diff line change 1- package org .scm4j .commons ;
1+ package org .scm4j .commons . coords ;
22
33import org .apache .commons .lang3 .StringUtils ;
4+ import org .scm4j .commons .CommentedString ;
5+ import org .scm4j .commons .Version ;
46
57public class CoordsGradle implements ICoords {
68
@@ -77,6 +79,11 @@ public Version getVersion() {
7779 return version ;
7880 }
7981
82+ @ Override
83+ public String getName () {
84+ return groupId + artifactId ;
85+ }
86+
8087 @ Override
8188 public String toString () {
8289 return sourceStr ;
@@ -88,7 +95,7 @@ public String toString(String versionStr) {
8895 if (!versionStr .isEmpty () || ((!name .isEmpty () && !(classifier + extension ).isEmpty ()))) {
8996 versionStr = ":" + versionStr ;
9097 }
91- return groupId + artifactId + versionStr + classifier + extension + commentStr ;
98+ return getName () + versionStr + classifier + extension + commentStr ;
9299 }
93100
94101 @ Override
Original file line number Diff line number Diff line change 1- package org .scm4j .commons ;
1+ package org .scm4j .commons . coords ;
22
33import org .apache .commons .lang3 .StringUtils ;
4+ import org .scm4j .commons .CommentedString ;
5+ import org .scm4j .commons .Version ;
46
57public class CoordsMaven implements ICoords {
68
@@ -68,7 +70,7 @@ public String toString(String versionStr) {
6870 if (!versionStr .isEmpty ()) {
6971 versionStr = ":" + versionStr ;
7072 }
71- return groupId + artifactId + extension + classifier + versionStr + commentStr ;
73+ return getName () + extension + classifier + versionStr + commentStr ;
7274 }
7375
7476 @ Override
@@ -85,4 +87,9 @@ public String getComment() {
8587 public Version getVersion () {
8688 return version ;
8789 }
90+
91+ @ Override
92+ public String getName () {
93+ return groupId + artifactId ;
94+ }
8895}
Original file line number Diff line number Diff line change 1- package org .scm4j .commons ;
1+ package org .scm4j .commons .coords ;
2+
3+ import org .scm4j .commons .Version ;
24
35public interface ICoords {
46
@@ -17,4 +19,6 @@ public interface ICoords {
1719 String getComment ();
1820
1921 Version getVersion ();
22+
23+ String getName ();
2024}
Original file line number Diff line number Diff line change 22
33import nl .jqno .equalsverifier .EqualsVerifier ;
44import org .junit .Test ;
5+ import org .scm4j .commons .coords .CoordsGradle ;
56
67import static org .junit .Assert .*;
78
Original file line number Diff line number Diff line change 22
33import nl .jqno .equalsverifier .EqualsVerifier ;
44import org .junit .Test ;
5+ import org .scm4j .commons .coords .CoordsGradle ;
6+ import org .scm4j .commons .coords .CoordsMaven ;
57
68import static org .junit .Assert .assertEquals ;
79import static org .junit .Assert .fail ;
You can’t perform that action at this time.
0 commit comments