
com.liferay.gradle.plugins.node.internal.util.GradleUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.gradle.plugins.node Show documentation
Show all versions of com.liferay.gradle.plugins.node Show documentation
The Node Gradle plugin lets you run Node.js and NPM as part of your build.
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.liferay.gradle.plugins.node.internal.util;
import java.io.File;
import org.gradle.api.Project;
import org.gradle.api.Task;
import org.gradle.api.tasks.TaskContainer;
/**
* @author Andrea Di Giorgi
*/
public class GradleUtil extends com.liferay.gradle.util.GradleUtil {
public static T fetchTask(
Project project, String taskName, Class clazz) {
TaskContainer taskContainer = project.getTasks();
Task task = taskContainer.findByName(taskName);
if (clazz.isInstance(task)) {
return (T)task;
}
return null;
}
public static File toFile(Project project, Object object) {
object = toObject(object);
if (object == null) {
return null;
}
return project.file(object);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy