Skip to content

Commit

Permalink
Remove references to AuraDS-aligned version layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Mats-SX committed Dec 10, 2024
1 parent 4643436 commit 4ac0493
Showing 1 changed file with 2 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,7 @@ void shouldReturnGradleVersion() throws IOException {

var buildInfo = BuildInfoProperties.get();

// strip Build identifier (for AuraDS releases)
// as the aurads flag is only a gradle property we cannot read the value here
String[] splits = buildInfo.gdsVersion().split("\\+");
assertThat(splits).hasSizeLessThanOrEqualTo(2);

var actualBaseVersion = splits[0];
var actualBuildLabel = splits.length > 1 ? splits[1] : "";

if (!actualBuildLabel.isEmpty()) {
var expectedQualifier = findAuraDSBuildLabel(file).orElseGet(() ->
fail("Could not find AuraDS qualifier in file: " + file.toAbsolutePath()));
assertEquals(expectedQualifier, actualBuildLabel);
}

assertEquals(expectedVersion, actualBaseVersion);
assertEquals(expectedVersion, buildInfo.gdsVersion());
}

@Test
Expand Down Expand Up @@ -119,17 +105,7 @@ void loadFromPropertiesRequiresVersion() {
}

private Optional<String> findVersion(Path file) throws IOException {
Pattern pattern = Pattern.compile(".*gdsBaseVersion = '(\\d+\\.\\d+\\.\\d+(-alpha\\d+|-beta\\d+)?)'.*");
try(var lines = Files.lines(file, StandardCharsets.UTF_8)) {
return lines
.flatMap(line -> pattern.matcher(line).results())
.map(i -> i.group(1))
.findFirst();
}
}

private Optional<String> findAuraDSBuildLabel(Path file) throws IOException {
Pattern pattern = Pattern.compile(".*gdsAuraDSVersion = '(\\d+)'");
Pattern pattern = Pattern.compile(".*gdsVersion = '(\\d+\\.\\d+\\.\\d+(-alpha\\d+|-beta\\d+)?)'.*");
try(var lines = Files.lines(file, StandardCharsets.UTF_8)) {
return lines
.flatMap(line -> pattern.matcher(line).results())
Expand Down

0 comments on commit 4ac0493

Please sign in to comment.