public void preserveCompileSourceRoots( List originalInterpolatedCompileSourceRoots ) { dynamicCompileSourceRoots = getCompileSourceRoots(); this.originalInterpolatedCompileSourceRoots = originalInterpolatedCompileSourceRoots; }
public void addCompileSourceRoot( String path ) { if ( path != null ) { path = path.trim(); if ( path.length() != 0 ) { if ( !getCompileSourceRoots().contains( path ) ) { getCompileSourceRoots().add( path ); } } } }
public void addCompileSourceRoot( String path ) { addPath( getCompileSourceRoots(), path ); }
/** * @throws MojoExecutionException * @throws MojoFailureException */ public void execute() throws MojoExecutionException, MojoFailureException { String out = targetDirectory.getPath(); for ( String src : project.getCompileSourceRoots() ) { if ( !src.startsWith( out ) ) { sourceFolders.add( src ); } } getLog().info( "Generating AAR file : " + project.getArtifactId() ); generateIntermediateApk(); final File outputFile = createAarLibraryFile( createAarClassesJar() ); if ( classifier == null ) { // Set the generated file as the main artifact (because the pom states <packaging>aar</packaging>) project.getArtifact().setFile( outputFile ); } else { // If there is a classifier specified, attach the artifact using that projectHelper.attachArtifact( project, AndroidExtension.AAR, classifier, outputFile ); } }
for (String sourceRoot : mavenProject.getCompileSourceRoots()) { builder.addSourcesDirectory(new File(sourceRoot).getAbsolutePath());
@Override public void execute(Speedment speedment) throws MojoExecutionException, MojoFailureException { getLog().info("Generating code using JSON configuration file: '" + configLocation().toAbsolutePath() + "'."); if (hasConfigFile()) { try { final Project project = speedment.getOrThrow(ProjectComponent.class).getProject(); speedment.getOrThrow(TranslatorManager.class).accept(project); // after generating the speedment code, the package location needs to be added as a source folder if (!mavenProject.getCompileSourceRoots().contains(mavenProject.getBasedir().getAbsolutePath() + "/" + project.getPackageLocation())) { System.out.println("adding new source location"); mavenProject.addCompileSourceRoot(mavenProject.getBasedir().getAbsolutePath() + "/" + project.getPackageLocation()); } } catch (final Exception ex) { final String err = "Error parsing configFile file."; LOGGER.error(ex, err); getLog().error(err); throw new MojoExecutionException(err, ex); } } else { final String err = "To run speedment:generate a valid configFile needs to be specified."; getLog().error(err); throw new MojoExecutionException(err); } }
for ( String src : project.getCompileSourceRoots() )
if ( project.getCompileSourceRoots() != null ) setCompileSourceRoots( ( new ArrayList<>( project.getCompileSourceRoots() ) ) );
if ( project.getCompileSourceRoots() != null ) setCompileSourceRoots( ( new ArrayList( project.getCompileSourceRoots() ) ) );
model = modelInterpolator.interpolate( model, project.getBasedir(), config, getLogger().isDebugEnabled() ); List originalInterpolatedCompileSourceRoots = interpolateListOfStrings( project.getCompileSourceRoots(), model, project.getBasedir(),
private void restoreBuildRoots( MavenProject project, ProjectBuilderConfiguration config, boolean debugMessages ) throws ModelInterpolationException { project.setCompileSourceRoots( restoreListOfStrings( project.getDynamicCompileSourceRoots(), project.getOriginalInterpolatedCompileSourceRoots(), project.getCompileSourceRoots(), project, config, debugMessages ) ); project.setTestCompileSourceRoots( restoreListOfStrings( project.getDynamicTestCompileSourceRoots(), project.getOriginalInterpolatedTestCompileSourceRoots(), project.getTestCompileSourceRoots(), project, config, debugMessages ) ); project.setScriptSourceRoots( restoreListOfStrings( project.getDynamicScriptSourceRoots(), project.getOriginalInterpolatedScriptSourceRoots(), project.getScriptSourceRoots(), project, config, debugMessages ) ); project.clearRestorableRoots(); }
@SuppressWarnings("unchecked") @Override public boolean test(MavenProject project) { return FCollection.contains(project.getTestCompileSourceRoots(), exists()) && FCollection.contains(project.getCompileSourceRoots(), exists()); }
private void addProjectFiles( final ReportAggregator.Builder reportAggregationBuilder, final MavenProject proj) throws IOException, Exception { final File projectBaseDir = proj.getBasedir(); List<File> files = getProjectFilesByFilter(projectBaseDir, MUTATION_RESULT_FILTER); for (final File file : files) { reportAggregationBuilder.addMutationResultsFile(file); } files = getProjectFilesByFilter(projectBaseDir, LINECOVERAGE_FILTER); for (final File file : files) { reportAggregationBuilder.addLineCoverageFile(file); } files = convertToRootDirs(proj.getCompileSourceRoots(), proj.getTestCompileSourceRoots()); for (final File file : files) { reportAggregationBuilder.addSourceCodeDirectory(file); } files = getCompiledDirs(proj); for (final File file : files) { reportAggregationBuilder.addCompiledCodeDirectory(file); } }
/** * @param p not null maven project. * @return the list of source paths for the given project. */ protected List<String> getProjectSourceRoots( MavenProject p ) { return ( p.getCompileSourceRoots() == null ? Collections.<String>emptyList() : new LinkedList<>( p.getCompileSourceRoots() ) ); }
protected void addSourcePath(String path) { if (!project.getCompileSourceRoots().contains(path)) { log.debug("Added Source directory: " + path); project.addCompileSourceRoot(path); } }
sourceRoots.addAll(this.mojo.getProject().getCompileSourceRoots()); sourceRoots.addAll(this.mojo.getProject().getTestCompileSourceRoots());
@Override protected String getSourcePath() { return StringUtils.joinWith(File.pathSeparator, StringUtils.join(this.project.getCompileSourceRoots(), File.pathSeparatorChar), StringUtils.join(this.project.getTestCompileSourceRoots(), File.pathSeparatorChar) ); }
@SuppressWarnings("unchecked") @Override public boolean test(MavenProject project) { return FCollection.contains(project.getTestCompileSourceRoots(), exists()) && FCollection.contains(project.getCompileSourceRoots(), exists()); }
private JavaDocBuilder createJavaDocBuilder() throws MojoExecutionException { JavaDocBuilder builder = new JavaDocBuilder(); builder.setEncoding( encoding ); builder.getClassLibrary().addClassLoader( getProjectClassLoader() ); for ( String sourceRoot : getProject().getCompileSourceRoots() ) { builder.getClassLibrary().addSourceFolder( new File( sourceRoot ) ); } return builder; }
private JavaDocBuilder createJavaDocBuilder() throws MojoExecutionException { JavaDocBuilder builder = new JavaDocBuilder(); builder.setEncoding( encoding ); builder.getClassLibrary().addClassLoader( getProjectClassLoader() ); for ( String sourceRoot : getProject().getCompileSourceRoots() ) { builder.getClassLibrary().addSourceFolder( new File( sourceRoot ) ); } return builder; }