Johannes bannhofer created MRELEASE-789:
-------------------------------------------

             Summary: Automatic Major/Minor/Patch version number increment
                 Key: MRELEASE-789
                 URL: https://jira.codehaus.org/browse/MRELEASE-789
             Project: Maven 2.x Release Plugin
          Issue Type: Improvement
          Components: prepare
    Affects Versions: 2.4
         Environment: Windows 7 / MAC OS X 10.5
            Reporter: Johannes bannhofer
         Attachments: mrelease_2.4_semantic versioning.patch

Hi,

i just added a feature for generating the next version number in batch mode.
Currently only the last number (either the last number of the digits array or 
the annotation revision is increased. With this batch the digit group to 
increase can be specified. Additionally I added an option for either keeping or 
deleting trailing zeros after a major/minor version change.

I added tests for checking the versioning, the old behaviour is still the same, 
all unit tests are working.

EXECUTION:
mvn release:prepare -B -DbatchIncGroup=1 -DbatchKeepTrailingZeros=true

CHANGES:
added two fields to modello model:
- batchKeepTrailingZeros
- batchIncGroup

Added an overloaded method of DefaultVersionInfo.getNextVersion

Added Testcases

Added loading/merging of the two new properties

Examples from DefaultVersionInfoTest:
        public void testNextVersionMajor() throws Exception {
                checkNextVersion("1", "2", 1, true);
                checkNextVersion("1.2", "2.0", 1, true);
                checkNextVersion("1.2.3", "2.0.0", 1, true);
                checkNextVersion("11.22.33.44", "12.0.0.0", 1, true);
                checkNextVersion("1.2", "2", 1, false);
                checkNextVersion("1", "2", 1, false);

        }

        public void testNextVersionMinor() throws Exception {
                checkNextVersion("1.2.3", "1.3.0", 2, true);
                checkNextVersion("1.2.345.678", "1.3.0.0", 2, true);
                checkNextVersion("1.2.3", "1.3", 2, false);
                checkNextVersion("1", "1.1", 2, false);

        }

        public void testNextVersionPatch() throws Exception {
                checkNextVersion("1.2.3", "1.2.4", 3, true);
                checkNextVersion("1.2.3", "1.2.4", 3, false);
                checkNextVersion("1", "1.0.1", 3, false);
                checkNextVersion("1-SNAPSHOT", "1.0.1-SNAPSHOT", 3, false);
                checkNextVersion("1.1", "1.1.1", 3, false);
                checkNextVersion("1.1.1", "1.1.2", 3, false);

                checkNextVersion("1", "1.0.0.0.1", 5, false);

        }

I hope that helps, I would check it in myself but I think it is a longer way to 
become a commiter :)

I do not have any ASF code style guide/formatter, where can I find one?

cheers joe


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://jira.codehaus.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to