Examples of GitTagDescription


Examples of com.github.koraktor.mavanagaiata.git.GitTagDescription

        FileUtils.forceDeleteOnExit(this.mojo.outputDirectory);

        when(this.mojo.project.getVersion()).thenReturn("1.2.3");

        when(this.repository.getAbbreviatedCommitId()).thenReturn("deadbeef");
        GitTagDescription description = mock(GitTagDescription.class);
        when(description.getNextTagName()).thenReturn("v1.2.3");
        when(description.toString()).thenReturn("v1.2.3-4-gdeadbeef");
        this.timestamp = new Date(1275131880000L);
        whenNew(Date.class).withNoArguments().thenReturn(this.timestamp);
        when(this.repository.describe()).thenReturn(description);
        when(this.repository.getHeadCommit().getId()).thenReturn("deadbeefdeadbeefdeadbeefdeadbeef");
    }
View Full Code Here

Examples of com.github.koraktor.mavanagaiata.git.GitTagDescription

        RevFlag seenFlag = RevFlag.UNINTERESTING;
        when(repo.revWalk.newFlag("SEEN")).thenReturn(seenFlag);

        when(this.repo.getObjectDatabase().newReader().abbreviate(head)).thenReturn(abbrevId);

        GitTagDescription description = repo.describe();
        assertThat(head.has(seenFlag), is(true));
        assertThat(head_1.has(seenFlag), is(false));
        assertThat(head_2.has(seenFlag), is(false));
        assertThat(description.getNextTagName(), is(equalTo("2.0.0")));
        assertThat(description.toString(), is(equalTo("2.0.0")));
    }
View Full Code Here

Examples of com.github.koraktor.mavanagaiata.git.GitTagDescription

        RevFlag seenFlag = RevFlag.UNINTERESTING;
        when(repo.revWalk.newFlag("SEEN")).thenReturn(seenFlag);

        when(this.repo.getObjectDatabase().newReader().abbreviate(head)).thenReturn(abbrevId);

        GitTagDescription description = repo.describe();
        assertThat(head.has(seenFlag), is(true));
        assertThat(head_1.has(seenFlag), is(true));
        assertThat(head_2.has(seenFlag), is(true));
        assertThat(description.getNextTagName(), is(equalTo("2.0.0")));
        assertThat(description.toString(), is(equalTo("2.0.0-2-g" + abbrevId.name())));
    }
View Full Code Here

Examples of com.github.koraktor.mavanagaiata.git.GitTagDescription

        RevFlag seenFlag = RevFlag.UNINTERESTING;
        when(this.repository.revWalk.newFlag("SEEN")).thenReturn(seenFlag);

        when(this.repo.getObjectDatabase().newReader().abbreviate(head)).thenReturn(abbrevId);

        GitTagDescription description = this.repository.describe();
        assertThat(head.has(seenFlag), is(true));
        assertThat(head_1.has(seenFlag), is(true));
        assertThat(head_2.has(seenFlag), is(true));
        assertThat(description.getNextTagName(), is(equalTo("")));
        assertThat(description.toString(), is(equalTo(abbrevId.name())));
    }
View Full Code Here

Examples of com.github.koraktor.mavanagaiata.git.GitTagDescription

            commits.clear();
            commits.addAll(nextCommits);
        }

        return new GitTagDescription(this, this.getHeadCommit(), nextTag, distance);
    }
View Full Code Here

Examples of com.github.koraktor.mavanagaiata.git.GitTagDescription

     *
     * @throws MavanagaiataMojoException if the tags cannot be read
     */
    public void run() throws MavanagaiataMojoException {
        try {
            GitTagDescription description = this.repository.describe();
            String describe = description.toString();
            if (this.dirtyFlag != null &&
                    this.repository.isDirty(this.dirtyIgnoreUntracked)) {
                describe += this.dirtyFlag;
            }

            this.addProperty("tag.describe", describe);
            this.addProperty("tag.name", description.getNextTagName());
        } catch(GitRepositoryException e) {
            throw MavanagaiataMojoException.create("Unable to read Git tag", e);
        }
    }
View Full Code Here

Examples of com.github.koraktor.mavanagaiata.git.GitTagDescription

        this.cleanup();
    }

    protected MapBasedValueSource getValueSource()
            throws GitRepositoryException {
        GitTagDescription description = this.repository.describe();

        String abbrevId  = this.repository.getAbbreviatedCommitId();
        String shaId     = this.repository.getHeadCommit().getId();
        String describe  = description.toString();
        boolean isDirty  = this.repository.isDirty(this.dirtyIgnoreUntracked);

        if (isDirty && this.dirtyFlag != null) {
            abbrevId += this.dirtyFlag;
            shaId    += this.dirtyFlag;
            describe += this.dirtyFlag;
        }

        SimpleDateFormat dateFormat = new SimpleDateFormat(this.dateFormat);
        HashMap<String, String> values = new HashMap<String, String>();
        values.put("CLASS_NAME", this.className);
        values.put("COMMIT_ABBREV", abbrevId);
        values.put("COMMIT_SHA", shaId);
        values.put("DESCRIBE", describe);
        values.put("DIRTY", Boolean.toString(isDirty));
        values.put("PACKAGE_NAME", this.packageName);
        values.put("TAG_NAME", description.getNextTagName());
        values.put("TIMESTAMP", dateFormat.format(new Date()));
        values.put("VERSION", this.project.getVersion());

        String version = VersionHelper.getVersion();
        if (version != null) {
View Full Code Here

Examples of com.github.koraktor.mavanagaiata.git.GitTagDescription

    @Before
    @Override
    public void setup() throws Exception {
        super.setup();

        GitTagDescription description = mock(GitTagDescription.class);
        when(description.getNextTagName()).thenReturn("2.0.0");
        when(description.toString()).thenReturn("2.0.0-2-gdeadbeef");
        when(this.repository.describe()).thenReturn(description);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.