Skip to content

Commit

Permalink
Rename printVersion task to version
Browse files Browse the repository at this point in the history
  • Loading branch information
sagebind committed Feb 28, 2019
1 parent c07ac8e commit 2b947d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'groovy'
id 'java-gradle-plugin'
id 'com.gradle.plugin-publish' version '0.10.1'
id 'com.widen.versioning' version '0.3.2'
id 'com.widen.versioning' version '0.4.0'
}

group = 'com.widen.oss'
Expand Down
9 changes: 6 additions & 3 deletions src/main/java/com/widen/versioning/VersioningPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@
import org.gradle.api.Task;

public class VersioningPlugin implements Plugin<Project> {
private static final String TASK_GROUP = "Versioning";
private static final String TASK_DESCRIPTION = "Prints the project's configured version";

@Override
public void apply(final Project project) {
// Make settings available to build script.
final Settings settings = project.getExtensions().create("versioning", Settings.class);

Task task = project.getTasks().create("printVersion");
task.setGroup("Versioning");
task.setDescription("Prints the project's configured version");
Task task = project.getTasks().create("version");
task.setGroup(TASK_GROUP);
task.setDescription(TASK_DESCRIPTION);
task.doLast(t -> System.out.println(project.getVersion()));

project.setVersion(new LazyVersion(project, settings));
Expand Down

0 comments on commit 2b947d9

Please sign in to comment.