// Path: src/main/java/org/unbrokendome/gradle/plugins/gitversion/version/SemVersion.java
// public interface SemVersion {
// 
//     int getMajor();
// 
//     int getMinor();
// 
//     int getPatch();
// 
//     @Nullable
//     String getPrereleaseTag();
// 
//     @Nullable
//     String getBuildMetadata();
// 
// 
//     @Nonnull
//     default MutableSemVersion cloneAsMutable() {
//         return new MutableSemVersionImpl()
//                 .setFrom(this);
//     }
// 
// 
//     @Nonnull
//     static SemVersion create(int major, int minor, int patch,
//                              @Nullable String prereleaseTag,
//                              @Nullable String buildMetadata) {
//         return new ImmutableSemVersionImpl(major, minor, patch, prereleaseTag, buildMetadata);
//     }
// 
// 
//     @Nonnull
//     static SemVersion create(int major, int minor, int patch, String prereleaseTag) {
//         return create(major, minor, patch, prereleaseTag, null);
//     }
// 
// 
//     @Nonnull
//     static SemVersion create(int major, int minor, int patch) {
//         return create(major, minor, patch, null, null);
//     }
// 
// 
//     @Nonnull
//     static SemVersion immutableCopyOf(SemVersion version) {
//         if (version instanceof ImmutableSemVersionImpl) {
//             return version;
// 
//         } else {
//             return create(version.getMajor(), version.getMinor(), version.getPatch(),
//                     version.getPrereleaseTag(), version.getBuildMetadata());
//         }
//     }
// 
// 
//     @Nonnull
//     static SemVersion parse(String input) {
//         return SemVersionParser.parse(input);
//     }
// }


import org.gradle.api.internal.ConventionTask;
import org.gradle.api.tasks.Internal;
import org.gradle.api.tasks.TaskAction;
import org.unbrokendome.gradle.plugins.gitversion.version.SemVersion;
import java.io.IOException;
import java.util.Collections;
package org.unbrokendome.gradle.plugins.gitversion.tasks;




/**
 * A task that prints the version on standard out.
 *
 * <p>This task reads the version from the file that was
 * written earlier by a {@link DetermineGitVersion} task.
 */
@SuppressWarnings("WeakerAccess")
public class ShowGitVersion extends ConventionTask {

    private DetermineGitVersion fromTask;


    @Internal
    public DetermineGitVersion getFromTask() {
        return fromTask;
    }


    public void setFromTask(DetermineGitVersion fromTask) {
        this.fromTask = fromTask;
        setDependsOn(Collections.singleton(fromTask));
    }


    public void from(DetermineGitVersion fromTask) {
        setFromTask(fromTask);
    }


    @TaskAction
    public void showGitVersion() throws IOException {
        if (fromTask != null) {
// Path: src/main/java/org/unbrokendome/gradle/plugins/gitversion/version/SemVersion.java
// public interface SemVersion {
// 
//     int getMajor();
// 
//     int getMinor();
// 
//     int getPatch();
// 
//     @Nullable
//     String getPrereleaseTag();
// 
//     @Nullable
//     String getBuildMetadata();
// 
// 
//     @Nonnull
//     default MutableSemVersion cloneAsMutable() {
//         return new MutableSemVersionImpl()
//                 .setFrom(this);
//     }
// 
// 
//     @Nonnull
//     static SemVersion create(int major, int minor, int patch,
//                              @Nullable String prereleaseTag,
//                              @Nullable String buildMetadata) {
//         return new ImmutableSemVersionImpl(major, minor, patch, prereleaseTag, buildMetadata);
//     }
// 
// 
//     @Nonnull
//     static SemVersion create(int major, int minor, int patch, String prereleaseTag) {
//         return create(major, minor, patch, prereleaseTag, null);
//     }
// 
// 
//     @Nonnull
//     static SemVersion create(int major, int minor, int patch) {
//         return create(major, minor, patch, null, null);
//     }
// 
// 
//     @Nonnull
//     static SemVersion immutableCopyOf(SemVersion version) {
//         if (version instanceof ImmutableSemVersionImpl) {
//             return version;
// 
//         } else {
//             return create(version.getMajor(), version.getMinor(), version.getPatch(),
//                     version.getPrereleaseTag(), version.getBuildMetadata());
//         }
//     }
// 
// 
//     @Nonnull
//     static SemVersion parse(String input) {
//         return SemVersionParser.parse(input);
//     }
// }


// Path: src/main/java/org/unbrokendome/gradle/plugins/gitversion/tasks/ShowGitVersion.java
import org.gradle.api.internal.ConventionTask;
import org.gradle.api.tasks.Internal;
import org.gradle.api.tasks.TaskAction;
import org.unbrokendome.gradle.plugins.gitversion.version.SemVersion;
import java.io.IOException;
import java.util.Collections;

package org.unbrokendome.gradle.plugins.gitversion.tasks;




/**
 * A task that prints the version on standard out.
 *
 * <p>This task reads the version from the file that was
 * written earlier by a {@link DetermineGitVersion} task.
 */
@SuppressWarnings("WeakerAccess")
public class ShowGitVersion extends ConventionTask {

    private DetermineGitVersion fromTask;


    @Internal
    public DetermineGitVersion getFromTask() {
        return fromTask;
    }


    public void setFromTask(DetermineGitVersion fromTask) {
        this.fromTask = fromTask;
        setDependsOn(Collections.singleton(fromTask));
    }


    public void from(DetermineGitVersion fromTask) {
        setFromTask(fromTask);
    }


    @TaskAction
    public void showGitVersion() throws IOException {
        if (fromTask != null) {
            SemVersion cachedVersion = fromTask.getCachedVersion();