/** * Configure the wrapper task * * @param wrapper Wrapper task to configure * @param projectConfig Project configuration to get required Gradle version */ @Defaults public void configureWrapperTask(@Each Wrapper wrapper, ProjectConfig projectConfig) { if (!Strings.isNullOrEmpty(projectConfig.getGradleVersion())) { wrapper.setGradleVersion(projectConfig.getGradleVersion()); } }
public static void configureWrapper(Wrapper wrapper) { wrapper.setGroup(GROUP); wrapper.setDescription("Generates Gradle wrapper files. [incubating]"); }
public static void createWrapperTask(Project project) { configureWrapper(project.getTasks().create("wrapper", Wrapper.class)); }
public static void addWrapperPlaceholder(ProjectInternal projectInternal) { if (projectInternal.getParent() == null) { projectInternal.getTasks().addPlaceholderAction("wrapper", Wrapper.class, new WrapperAction()); } }
@Override public void execute(Wrapper wrapper) { configureWrapper(wrapper); }