/** * Get the URLs for the classpath during annotation processing * * @return Classpath URLs */ @Input @Classpath protected Set<URL> getClasspathUrls() { Configuration compileConfiguration = getProject().getConfigurations() .getByName(EclipseConfigPlugin.ECLIPSE_ANNOTATIONS_CONFIGURATION); getLogger().info("Using classpath '{}'", compileConfiguration.getAsPath()); Set<URL> urls = compileConfiguration.getFiles().stream().map(f -> { try { return f.toURI().toURL(); } catch (MalformedURLException e) { throw new GradleException( String.format("Could not create classpath for annotations task %s.", getName()), e); } }).collect(Collectors.toSet()); return ImmutableSet.copyOf(urls); } }
/** * Get the URLs for the classpath during annotation processing * * @return Classpath URLs */ @Input @Classpath protected Set<URL> getClasspathUrls() { Configuration compileConfiguration = getProject().getConfigurations() .getByName(EclipseConfigPlugin.ECLIPSE_ANNOTATIONS_CONFIGURATION); getLogger().info("Using classpath '{}'", compileConfiguration.getAsPath()); Set<URL> urls = compileConfiguration.getFiles().stream().map(f -> { try { return f.toURI().toURL(); } catch (MalformedURLException e) { throw new GradleException( String.format("Could not create classpath for annotations task %s.", getName()), e); } }).collect(Collectors.toSet()); return ImmutableSet.copyOf(urls); } }
.put("failonerror", true) .put("includeantruntime", false) .put("classpath", getProject().getConfigurations().getByName(classpath).getAsPath()) .put("encoding", "utf-8") .put("source", "1.8")
private void performWeaving(ClassLoader classLoader) throws URISyntaxException, IOException { this.logger.debug("source = " + this.source); this.logger.debug("target = " + this.target); this.logger.debug("classpath = " + this.getProject().getConfigurations().findByName("compile").getAsPath()); final StaticWeaveProcessor weaveProcessor = new StaticWeaveProcessor(this.source, this.target); weaveProcessor.setPersistenceInfo(this.getTemporaryDir().toURI().toURL()); weaveProcessor.setClassLoader(classLoader); weaveProcessor.setLog(new PrintWriter(System.out)); weaveProcessor.setLogLevel(AbstractSessionLog.translateStringToLoggingLevel(Optional.ofNullable(this.logLevel).orElse(DEFAULT_LOG_LEVEL).toUpperCase())); weaveProcessor.performWeaving(); } }
@Override public void execute(JavaExecSpec spec) { getLogger().lifecycle(CONFIG_MESSAGE, getFormat(), formatPath(getBaseDir()), formatPath(getDestDir())); getLogger().info("Using main class {}", getMainClass()); Configuration configuration = getProject().getConfigurations().getAt(CONFIGURATION_NAME); String toolPath = configuration.getAsPath(); spec.setIgnoreExitValue(true); spec.setClasspath(createToolClasspath(configuration)); spec.setMain(getMainClass()); spec.args(getFormat(), getBaseDir().getAbsolutePath(), getDestDir().getAbsolutePath(), toolPath); }
public void configure(Project project, JettyOption jettyOption, File jettyConf) { ConfigurationContainer configs = project.getConfigurations(); Configuration runtimeConf = configs.getByName(WarPlugin.PROVIDED_RUNTIME_CONFIGURATION_NAME); Configuration jettyClassPath = configs.getByName(PwtLibPlugin.CONF_JETTY); configureJavaArgs(jettyOption); addClassPath(jettyClassPath.getAsPath()); addClassPath(runtimeConf.getAsPath()); if (jettyOption.getLogRequestFile() != null) { ResourceUtils.ensureDir(jettyOption.getLogRequestFile().getParentFile()); addArg("--log", jettyOption.getLogRequestFile()); } if (jettyOption.getLogFile() != null) { ResourceUtils.ensureDir(jettyOption.getLogFile().getParentFile()); addArg("--out", jettyOption.getLogFile()); } addArg("--host", jettyOption.getBindAddress()); addArg("--port", jettyOption.getPort()); addArg("--stop-port", jettyOption.getStopPort()); addArg("--stop-key", jettyOption.getStopKey()); addArg(jettyConf.getAbsolutePath()); }
public void configure(Project project, JettyOption jettyOption, File jettyConf) { ConfigurationContainer configs = project.getConfigurations(); Configuration runtimeConf = configs.getByName(WarPlugin.PROVIDED_RUNTIME_CONFIGURATION_NAME); Configuration jettyClassPath = configs.getByName(GwtLibPlugin.CONF_JETTY); configureJavaArgs(jettyOption); addClassPath(jettyClassPath.getAsPath()); addClassPath(runtimeConf.getAsPath()); if (jettyOption.getLogRequestFile() != null) { ResourceUtils.ensureDir(jettyOption.getLogRequestFile().getParentFile()); addArg("--log", jettyOption.getLogRequestFile()); } if (jettyOption.getLogFile() != null) { ResourceUtils.ensureDir(jettyOption.getLogFile().getParentFile()); addArg("--out", jettyOption.getLogFile()); } addArg("--host", jettyOption.getBindAddress()); addArg("--port", jettyOption.getPort()); addArg("--stop-port", jettyOption.getStopPort()); addArg("--stop-key", jettyOption.getStopKey()); addArg(jettyConf.getAbsolutePath()); }
addClassPath(mainSourceSet.getAllJava().getSrcDirs()); addClassPath(mainSourceSet.getCompileClasspath().getAsPath()); addClassPath(sdmConf.getAsPath());
addClassPath(mainSourceSet.getAllJava().getSrcDirs()); addClassPath(mainSourceSet.getCompileClasspath().getAsPath()); addClassPath(sdmConf.getAsPath());