本文整理匯總了Java中org.gradle.api.logging.Logger.lifecycle方法的典型用法代碼示例。如果您正苦於以下問題:Java Logger.lifecycle方法的具體用法?Java Logger.lifecycle怎麽用?Java Logger.lifecycle使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.gradle.api.logging.Logger
的用法示例。
在下文中一共展示了Logger.lifecycle方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: DependencyConfigs
import org.gradle.api.logging.Logger; //導入方法依賴的package包/類
public DependencyConfigs(@Nonnull final Project pProject)
{
project = pProject;
buildUtil = new BuildUtil(pProject);
depConfigDir = new File(pProject.getProjectDir(), "project/dependencyConfigs");
final FileCollection listOfDepConfigFiles = readListOfDepConfigs(depConfigDir);
depConfigs = readAllDependencyVersions(listOfDepConfigFiles);
if (getDefault() == null || !DEFAULT_NAME.equals(getDefault().getName()) || !getDefault().isDefaultConfig()) {
throw new GradleException("corrupt default dependency configuration");
}
final Logger log = pProject.getLogger();
log.lifecycle("Default Checkstyle version: " + getDefault().getCheckstyleBaseVersion());
log.lifecycle("Active dependency configurations:");
for (Map.Entry<String, DependencyConfig> entry : depConfigs.entrySet()) {
DependencyConfig depConfig = entry.getValue();
log.lifecycle(" - " + entry.getKey() + ": Checkstyle " + depConfig.getCheckstyleBaseVersion() //
+ ", Java " + depConfig.getJavaLevel() //
+ ", compatible: " + depConfig.getCompatibleCheckstyleVersions());
}
}
示例2: logHealth
import org.gradle.api.logging.Logger; //導入方法依賴的package包/類
public void logHealth(DaemonHealthStats stats, Logger logger) {
if (Boolean.getBoolean(HEALTH_MESSAGE_PROPERTY)) {
logger.lifecycle(stats.getHealthInfo());
} else {
//the default
logger.info(stats.getHealthInfo());
}
}
示例3: run
import org.gradle.api.logging.Logger; //導入方法依賴的package包/類
String run(Logger log, List<String> commandLine) {
// WARNING!!! ensure that masked command line is used for all logging!!!
String maskedCommandLine = mask(join(commandLine, " "));
log.lifecycle(" Executing:\n " + maskedCommandLine);
ProcessResult result = executeProcess(commandLine, maskedCommandLine);
if (result.getExitValue() != 0) {
return executionOfCommandFailed(maskedCommandLine, result);
} else {
String output = result.getOutput();
LOG.info("Output from external process '{}':\n{}", maskedCommandLine, output);
return output;
}
}
示例4: downloadMcJson
import org.gradle.api.logging.Logger; //導入方法依賴的package包/類
public static void downloadMcJson(LoomGradleExtension extension, Logger logger) throws IOException {
if (!Constants.MINECRAFT_JSON.get(extension).exists()) {
logger.lifecycle(":downloading minecraft json");
FileUtils.copyURLToFile(new URL("https://launchermeta.mojang.com/mc/game/version_manifest.json"), Constants.VERSION_MANIFEST.get(extension));
ManifestVersion mcManifest = new GsonBuilder().create().fromJson(FileUtils.readFileToString(Constants.VERSION_MANIFEST.get(extension), "UTF-8"), ManifestVersion.class);
Optional<ManifestVersion.Versions> optionalVersion = mcManifest.versions.stream().filter(versions -> versions.id.equalsIgnoreCase(extension.version)).findFirst();
if (optionalVersion.isPresent()) {
FileUtils.copyURLToFile(new URL(optionalVersion.get().url), Constants.MINECRAFT_JSON.get(extension));
} else {
logger.info(":failed downloading minecraft json");
throw new RuntimeException("Failed downloading Minecraft json");
}
}
}
示例5: uninstall
import org.gradle.api.logging.Logger; //導入方法依賴的package包/類
@TaskAction
public void uninstall() throws DeviceException {
final Logger logger = getLogger();
final String applicationId = variant.getApplicationId();
logger.info("Uninstalling app: {}", applicationId);
final ILogger lifecycleLogger = new LoggerWrapper(getLogger(), LogLevel.LIFECYCLE);
final DeviceProvider deviceProvider =
new ConnectedDeviceProvider(getAdbExe(), lifecycleLogger);
deviceProvider.init();
final List<? extends DeviceConnector> devices = deviceProvider.getDevices();
for (DeviceConnector device : devices) {
device.uninstallPackage(applicationId, getTimeOutInMs(), getILogger());
logger.lifecycle(
"Uninstalling {} (from {}:{}) from device '{}' ({}).",
applicationId, getProject().getName(),
variant.getVariantConfiguration().getFullName(),
device.getName(), device.getSerialNumber());
}
int n = devices.size();
logger.quiet("Uninstalled {} from {} device{}.",
applicationId, n, n == 1 ? "" : "s");
}
示例6: DeviceFarmClientFactory
import org.gradle.api.logging.Logger; //導入方法依賴的package包/類
public DeviceFarmClientFactory(final Logger logger) {
this.pluginVersion = readPluginVersion();
logger.lifecycle("AWS Device Farm Plugin version " + pluginVersion);
}