-
Notifications
You must be signed in to change notification settings - Fork 267
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
68 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/invoker.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
invoker.goals=${project.groupId}:${project.artifactId}:${project.version}:set-version-from-scm-tag -DpropertyName=version_from_scm |
11 changes: 11 additions & 0 deletions
11
versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>localhost</groupId> | ||
<artifactId>it-dynamic-versioning-scm-tag-env-use-version</artifactId> | ||
<version>${revision}</version> | ||
<packaging>pom</packaging> | ||
<name>ranges-update-report</name> | ||
<url>http://localhost/</url> | ||
</project> |
10 changes: 10 additions & 0 deletions
10
versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/selector.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
try { | ||
// smoke test if we have a needed tools | ||
def gitVersion = "git --version".execute() | ||
gitVersion.consumeProcessOutput(System.out, System.out) | ||
gitVersion.waitFor() | ||
return gitVersion.exitValue() == 0 | ||
} catch (Exception e) { | ||
// some error occurs - we skip a test | ||
return false | ||
} |
13 changes: 13 additions & 0 deletions
13
versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/setup.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
void exec(String command) { | ||
def proc = command.execute(null, basedir) | ||
proc.consumeProcessOutput(System.out, System.out) | ||
proc.waitFor() | ||
assert proc.exitValue() == 0 : "Command '${command}' returned status: ${proc.exitValue()}" | ||
} | ||
|
||
def testFile = new File(basedir, 'test.txt') | ||
testFile << 'content' | ||
|
||
exec('git init') | ||
exec('git add test.txt') | ||
exec('git commit -m initial-commit') |
19 changes: 19 additions & 0 deletions
19
versions-maven-plugin/src/it/it-dynamic-versioning-scm-tag-property-name/verify.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// check that property was set | ||
|
||
def mavenLogFile = new File(basedir, 'build.log') | ||
assert mavenLogFile.exists() : "Maven log file does not exist" | ||
|
||
// Read the log file | ||
def logContent = mavenLogFile.text | ||
|
||
// Define a pattern to match the version output | ||
def versionPattern = /\[INFO\] Property 'version_from_scm' set to: (.+)/ | ||
def matcher = (logContent =~ versionPattern) | ||
assert matcher.find() : "Version information not found in log file" | ||
|
||
// Extract the version from the matched group | ||
def actualVersion = matcher[0][1] | ||
|
||
def expectedVersion = '0.0.1-1-SNAPSHOT' | ||
|
||
assert actualVersion == expectedVersion : "Expected version '${expectedVersion}', but found '${actualVersion}'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters