private ClassLoader toClassLoader(FileCollection runtimeClasspath) { List<URL> urls = new ArrayList<URL>(); for ( File file : runtimeClasspath ) { try { urls.add( file.toURI().toURL() ); logger.debug( "Adding classpath entry for " + file.getAbsolutePath() ); } catch (MalformedURLException e) { throw new GradleException( "Unable to resolve classpath entry to URL : " + file.getAbsolutePath(), e ); } } return new URLClassLoader( urls.toArray( new URL[urls.size()] ), Enhancer.class.getClassLoader() ); }
new UnionFileCollection(javaCompiler.getSource(), project.fileTree(destinationFolder)); javaCompiler.setSource(uft); logger.debug("Analyzing configuration: " + variantCompileClasspath.getFiles()); Set<String> targetActivities = new HashSet<>(); Streams.stream(variantCompileClasspath) .forEach( dependency -> { logger.debug("Detected dependency: {}", dependency.getAbsolutePath()); if (dependency.getName().endsWith(".jar")) { logger.debug("Detected navigation API dependency: {}", dependency.getName()); if (!dependency.exists()) { logger.debug("Dependency jar doesn't exist {}", dependency.getAbsolutePath()); } else { File file = dependency.getAbsoluteFile(); entry -> { if (entry.matches(".*__IntentBuilder.class")) { logger.debug("Detected intent builder: {}", entry); String targetActivityFQN = entry File generatedFile = getHensonNavigatorSourceFile(); try { logger.debug("Generating Henson navigator in " + generatedFile.getAbsolutePath()); logger.debug(hensonNavigator); Files.write(generatedFile.toPath(), singletonList(hensonNavigator)); } catch (IOException e) {
private void runTask(final ProjectConnection connection, final Path path, final String task) { synchronized (LOCK) { Map<String, String> xml = new HashMap<>(); try { // clean jaxp XML_PROPS.forEach(p -> xml.put(p, (String) System.getProperties().remove(p))); try { connection.newBuild() .setStandardError(System.err) .setStandardOutput(System.out) .forTasks(task) .run(); } catch (Exception ex) { getLogger().debug("Execution of " + task + " resulted in exception", ex); } } finally { // restore jaxp xml.forEach((k, v) -> { if (v != null) { System.setProperty(k, v); } }); } } }
public void apply(Project project) { project.getPlugins().apply( "java" ); final HibernateExtension hibernateExtension = new HibernateExtension( project ); project.getLogger().debug( "Adding Hibernate extensions to the build [{}]", project.getName() ); project.getExtensions().add( "hibernate", hibernateExtension ); project.afterEvaluate( new Action<Project>() { @Override public void execute(Project project) { if ( hibernateExtension.enhance != null ) { applyEnhancement( project, hibernateExtension ); } } } ); }
@TaskAction public void process() throws Throwable { Project project = getProject(); JoobyProject joobyProject = new JoobyProject(project); String mainClass = getMainClassName(); try (URLClassLoader loader = joobyProject.newClassLoader()) { getLogger().debug("Using classloader " + loader); Path srcdir = project.getProjectDir().toPath(); Path bindir = joobyProject.classes().toPath(); Path output = new ApiParser(srcdir) .with(loader) .export(bindir, mainClass); getLogger().info("API file: " + output); } }
@Override public void execute(Task task) { project.getLogger().debug( "Starting Hibernate enhancement on SourceSet.{}", sourceSet.getName() );
project.getLogger().debug( "Applying Hibernate enhancement action to SourceSet.{}", sourceSet.getName() );
private void check(Formatter formatter, List<File> outOfDate) throws Exception { List<File> problemFiles = new ArrayList<>(); for (File file : outOfDate) { getLogger().debug("Checking format on " + file); if (!formatter.isClean(file)) { problemFiles.add(file); } } if (paddedCell) { PaddedCellGradle.check(this, formatter, problemFiles); } else { if (!problemFiles.isEmpty()) { // if we're not in paddedCell mode, we'll check if maybe we should be if (PaddedCellBulk.anyMisbehave(formatter, problemFiles)) { throw PaddedCellGradle.youShouldTurnOnPaddedCell(this); } else { throw formatViolationsFor(formatter, problemFiles); } } } }
if (isPaddedCell()) { for (File file : outOfDate) { getLogger().debug("Applying format to " + file); if (PaddedCellBulk.applyAnyChanged(formatter, file)) { changed.add(file); boolean anyMisbehave = false; for (File file : outOfDate) { getLogger().debug("Applying format to " + file); String unixResultIfDirty = formatter.applyToAndReturnResultIfDirty(file); if (unixResultIfDirty != null) {
@Override public void addSupportedAbi(AbiDetails triple) { supportedAbis.add(triple); logger.debug("Available ABI's: {}", supportedAbis); }
public void abortProcess() { lock.lock(); try { aborted = true; if (process != null) { LOGGER.debug("Abort requested. Destroying process: {}.", execHandle.getDisplayName()); process.destroy(); } } finally { lock.unlock(); } }
@Override public boolean isSatisfiedBy(Task task) { getLogger().debug("Install task is always run."); return false; } });
public void writeFactory(String name, String data) { logger.debug("writing Factory data : {}", data); try { Files.write(this.internalPath.resolve(name), data.getBytes()); } catch (IOException e) { logger.error("error writing Factory ", e); } }
public AbstractJavaccTask setOutputDirectory(File outputDirectory) { getLogger().debug("Changing output directory to [{}]", outputDirectory); this.outputDirectory = outputDirectory; return this; }
void injectSelectedProfile(Profile selectedProfile) { if ( this.profile != null ) { // error? for now, just log it project.getLogger().debug( "replacing selected Profile : %s -> %s", profile, selectedProfile ); } this.resolved = true; this.profile = selectedProfile; }
private DatabaseProfile findDatabaseProfile(File directory) { final File matrixDotGradleFile = new File( directory, MATRIX_BUILD_FILE ); if ( matrixDotGradleFile.exists() && matrixDotGradleFile.isFile() ) { project.getLogger().debug( "Found matrix.gradle file : " + matrixDotGradleFile ); return new MatrixDotGradleProfile( matrixDotGradleFile, project ); } final File jdbcDirectory = new File( directory, JDBC_DIR ); if ( jdbcDirectory.exists() && jdbcDirectory.isDirectory() ) { return new JdbcDirectoryProfile( jdbcDirectory, project ); } return null; }
public String serialize(ProjectContributorsSet contributorsSet) { Collection<ProjectContributor> allContributors = contributorsSet.getAllContributors(); String json = Jsoner.serialize(allContributors); LOG.debug("Serialize contributors to: {}", json); return json; }
private FileVisitResult visitRepoRoot(String packagePath, Path currentPath) { LOGGER.debug("Produce recognized package {}.", packagePath); dependencies.add(createDependency(packagePath, currentPath)); return FileVisitResult.SKIP_SUBTREE; }