The source folders returned are project relative, e.g. "src" or "src/main/java"
@since 2.6
350898
public Set<String> getSourceFolders() {
		Set<String> sourceFolders = Sets.newLinkedHashSet();
		for (SourceMapping mapping : getSourceMappings()) {
			sourceFolders.add(mapping.getSourceFolder());
		}
		return sourceFolders;
	}
986782
private static InputStream inputStreamFromAssets(GraphicFactory graphicFactory, String relativePathPrefix, String src) throws IOException {
        InputStream inputStream = null;
        try {
            inputStream = graphicFactory.platformSpecificSources(relativePathPrefix, src);
        } catch (IOException e) {
        }
        if (inputStream != null) {
            return inputStream;
        }
        return null;
    }
531267
@Nullable
  private File findProjectGitDirectory() {
    if (this.mavenProject == null) {
      return null;
    }

    File basedir = mavenProject.getBasedir();
    while (basedir != null) {
      File gitdir = new File(basedir, Constants.DOT_GIT);
      if (gitdir.exists()) {
        if (gitdir.isDirectory()) {
          return gitdir;
        } else if (gitdir.isFile()) {
          return processGitDirFile(gitdir);
        } else {
          return null;
        }
      }
      basedir = basedir.getParentFile();
    }
    return null;
  }
469634
function getInputSources(dirname, exclude, include, focusContractPath, callback) {
  let filesRead = 0;
  const sources = {};

  // get all file names
  dir.files(dirname, (filesError, files) => {
    if (filesError) {
      throwError(`while while getting input sources ${filesError}`);
    }

    // if no files in directory, then fire callback with empty sources
    if (files.length === 0) {
      callback(null, sources);
    } else {
      // read all files
      dir.readFiles(dirname, (readFilesError, content, filename, next) => {
        if (readFilesError) {
          throwError(`while getting input sources ${readFilesError}`);
        }

        // parsed filename
        const parsedDirName = dirname.replace('./', '');
        const parsedFileName = filename.replace(parsedDirName, '').replace(/^\//, '');
        const onlyFilename = filename.substr(filename.lastIndexOf('/') + 1);

        // add input sources to output
        if (filename.substr(filename.lastIndexOf('.') + 1) === 'sol'
          && filenameInclude(filename, exclude, include)
          && onlyFilename.charAt(0) !== '~'
          && onlyFilename.charAt(0) !== '#'
          && onlyFilename.charAt(0) !== '.') {
          sources[parsedFileName] = content;
        }

        // increase files readFiles
        filesRead += 1;

        // process next file
        if (filesRead === files.length) {
          // filter sources by focus dependencies
          if (focusContractPath) {
            callback(null, buildDependantsSourceTree(focusContractPath, sources));
          } else {
            callback(null, sources);
          }
        } else {
          next();
        }
      });
    }
  });
}
406957
static public void scanRoot(File root,
                                Set<String> suffixes,
                                List<String> excludes,
                                List<String> includes,
                                Map<String,Source> foundFiles,
                                Map<String,Module> foundModules,
                                final Module currentModule,
                                boolean permitSourcesWithoutPackage,
                                boolean inGensrc,
                                boolean inLinksrc)
                                        throws IOException, ProblemException {

        if (root == null)
            return;

        FileSystem fs = root.toPath().getFileSystem();

        if (includes.isEmpty()) {
            includes = Collections.singletonList("**");
        }

        List<PathMatcher> includeMatchers = createPathMatchers(fs, includes);
        List<PathMatcher> excludeMatchers = createPathMatchers(fs, excludes);

        Files.walkFileTree(root.toPath(), new SimpleFileVisitor<Path>() {
            @Override
            public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {

                Path relToRoot = root.toPath().relativize(file);

                if (includeMatchers.stream().anyMatch(im -> im.matches(relToRoot))
                        && excludeMatchers.stream().noneMatch(em -> em.matches(relToRoot))
                        && suffixes.contains(Util.fileSuffix(file))) {

                    // TODO: Test this.
                    Source existing = foundFiles.get(file);
                    if (existing != null) {
                        throw new IOException("You have already added the file "+file+" from "+existing.file().getPath());
                    }
                    existing = currentModule.lookupSource(file.toString());
                    if (existing != null) {

                            // Oups, the source is already added, could be ok, could be not, lets check.
                            if (inLinksrc) {
                                // So we are collecting sources for linking only.
                                if (existing.isLinkedOnly()) {
                                    // Ouch, this one is also for linking only. Bad.
                                    throw new IOException("You have already added the link only file " + file + " from " + existing.file().getPath());
                                }
                                // Ok, the existing source is to be compiled. Thus this link only is redundant
                                // since all compiled are also linked to. Continue to the next source.
                                // But we need to add the source, so that it will be visible to linking,
                                // if not the multi core compile will fail because a JavaCompiler cannot
                                // find the necessary dependencies for its part of the source.
                                foundFiles.put(file.toString(), existing);
                            } else {
                                // We are looking for sources to compile, if we find an existing to be compiled
                                // source with the same name, it is an internal error, since we must
                                // find the sources to be compiled before we find the sources to be linked to.
                                throw new IOException("Internal error: Double add of file " + file + " from " + existing.file().getPath());
                            }

                    } else {

                        //////////////////////////////////////////////////////////////
                        // Add source
                        Source s = new Source(currentModule, file.toString(), file.toFile());
                        if (inGensrc) {
                            s.markAsGenerated();
                        }
                        if (inLinksrc) {
                            s.markAsLinkedOnly();
                        }
                        String pkg = packageOfJavaFile(root.toPath(), file);
                        pkg = currentModule.name() + ":" + pkg;
                        foundFiles.put(file.toString(), s);
                        currentModule.addSource(pkg, s);
                        //////////////////////////////////////////////////////////////
                    }
                }

                return FileVisitResult.CONTINUE;
            }
        });
    }
40485
private List<String> getSourceRoots( final MavenProject project, final String scope )
    {
        if ( SCOPE_COMPILE.equals( scope ) || SCOPE_RUNTIME.equals( scope ) )
        {
            return project.getCompileSourceRoots();
        }
        else if ( SCOPE_TEST.equals( scope ) )
        {
            List<String> sourceRoots = new ArrayList<String>();
            sourceRoots.addAll( project.getTestCompileSourceRoots() );
            sourceRoots.addAll( project.getCompileSourceRoots() );
            return sourceRoots;
        }
        else
        {
            throw new RuntimeException( "Not allowed scope " + scope );
        }
    }
772000
public File getDirectory(String targetProject, String targetPackage)
      throws ShellException {
    // targetProject is interpreted as a directory that must exist
    //
    // targetPackage is interpreted as a sub directory, but in package
    // format (with dots instead of slashes). The sub directory will be
    // created
    // if it does not already exist

    File project = new File(targetProject);
    if (!project.isDirectory()) {
      throw new ShellException(getString("Warning.9", //$NON-NLS-1$
          targetProject));
    }

    StringBuilder sb = new StringBuilder();
    StringTokenizer st = new StringTokenizer(targetPackage, "."); //$NON-NLS-1$
    while (st.hasMoreTokens()) {
      sb.append(st.nextToken());
      sb.append(File.separatorChar);
    }

    File directory = new File(project, sb.toString());
    if (!directory.isDirectory()) {
      boolean rc = directory.mkdirs();
      if (!rc) {
        throw new ShellException(getString("Warning.10", //$NON-NLS-1$
            directory.getAbsolutePath()));
      }
    }

    return directory;
  }
25204
function (buildConfig) {
        var src;
        if (buildConfig.nodeProject) {
            src = '<%=buildConfig.libDirectory%>/**/*.js';
        } else if (buildConfig.bowerJSON) {
            src = buildConfig.bowerJSON.main;
        }

        return src;
    }
274947
@SuppressWarnings({"checkstyle:magicnumber", "checkstyle:npathcomplexity"})
	protected void addSourceFolders(
			IMavenProjectFacade facade, SARLConfiguration config,
			IClasspathDescriptor classpath, IProgressMonitor monitor)
					throws CoreException {

		assertHasNature(facade.getProject(), SARLEclipseConfig.NATURE_ID);
		assertHasNature(facade.getProject(), SARLEclipseConfig.XTEXT_NATURE_ID);
		assertHasNature(facade.getProject(), JavaCore.NATURE_ID);

		final String encoding = config.getEncoding();

		final SubMonitor subMonitor = SubMonitor.convert(monitor, 4);

		//
		// Add the source folders
		//
		// Input folder, e.g. "src/main/sarl"
		final IPath inputPath = makeFullPath(facade, config.getInput());
		final IFolder inputFolder = ensureFolderExists(facade, inputPath, false, subMonitor);
		if (encoding != null && inputFolder != null && inputFolder.exists()) {
			inputFolder.setDefaultCharset(encoding, monitor);
		}
		IClasspathEntryDescriptor descriptor = classpath.addSourceEntry(
				inputPath,
				facade.getOutputLocation(),
				false);
		descriptor.setPomDerived(true);
		subMonitor.worked(1);

		// Input folder, e.g. "src/main/generated-sources/sarl"
		final IPath outputPath = makeFullPath(facade, config.getOutput());
		final IFolder outputFolder = ensureFolderExists(facade, outputPath, true, subMonitor);
		if (encoding != null && outputFolder != null && outputFolder.exists()) {
			outputFolder.setDefaultCharset(encoding, monitor);
		}
		descriptor = classpath.addSourceEntry(
				outputPath,
				facade.getOutputLocation(),
				false);
		descriptor.setPomDerived(true);
		descriptor.setClasspathAttribute(IClasspathAttribute.IGNORE_OPTIONAL_PROBLEMS, Boolean.TRUE.toString());
		subMonitor.worked(1);

		// Test input folder, e.g. "src/test/sarl"
		final IPath testInputPath = makeFullPath(facade, config.getTestInput());
		final IFolder testInputFolder = ensureFolderExists(facade, testInputPath, false, subMonitor);
		if (encoding != null && testInputFolder != null && testInputFolder.exists()) {
			testInputFolder.setDefaultCharset(encoding, monitor);
		}
		descriptor = classpath.addSourceEntry(
				testInputPath,
				facade.getTestOutputLocation(),
				true);
		descriptor.setPomDerived(true);
		descriptor.setClasspathAttribute(IClasspathAttribute.TEST, Boolean.TRUE.toString());
		subMonitor.worked(1);

		// Test input folder, e.g. "src/test/generated-sources/sarl"
		final IPath testOutputPath = makeFullPath(facade, config.getTestOutput());
		final IFolder testOutputFolder = ensureFolderExists(facade, testOutputPath, true, subMonitor);
		if (encoding != null && testOutputFolder != null && testOutputFolder.exists()) {
			testOutputFolder.setDefaultCharset(encoding, monitor);
		}
		descriptor = classpath.addSourceEntry(
				testOutputPath,
				facade.getTestOutputLocation(),
				true);
		descriptor.setPomDerived(true);
		descriptor.setClasspathAttribute(IClasspathAttribute.IGNORE_OPTIONAL_PROBLEMS, Boolean.TRUE.toString());
		descriptor.setClasspathAttribute(IClasspathAttribute.TEST, Boolean.TRUE.toString());
		subMonitor.done();
	}
216728
@Override
  public final void attachNars(final File baseDir, final ArchiverManager archiverManager,
      final MavenProjectHelper projectHelper, final MavenProject project) throws MojoExecutionException {
    if (getNoArchDirectory(baseDir, project.getArtifactId(), project.getVersion()).exists()) {
      attachNar(archiverManager, projectHelper, project, NarConstants.NAR_NO_ARCH,
          getNoArchDirectory(baseDir, project.getArtifactId(), project.getVersion()), "*/**");
    }

    // list all directories in basedir, scan them for classifiers
    final String[] subDirs = baseDir.list();
    for (int i = 0; subDirs != null && i < subDirs.length; i++) {
      final String artifactIdVersion = project.getArtifactId() + "-" + project.getVersion();

      // skip entries not belonging to this project
      if (!subDirs[i].startsWith(artifactIdVersion)) {
        continue;
      }

      final String classifier = subDirs[i].substring(artifactIdVersion.length() + 1);

      // skip noarch here
      if (classifier.equals(NarConstants.NAR_NO_ARCH)) {
        continue;
      }

      final File dir = new File(baseDir, subDirs[i]);
      attachNar(archiverManager, projectHelper, project, classifier, dir, "*/**");
    }
  }
172241
protected void addSourceFolder(String path) {
		final List<String> existingFolders1 = this.project.getCompileSourceRoots();
		final List<String> existingFolders2 = this.project.getTestCompileSourceRoots();
		if (!existingFolders1.contains(path) && !existingFolders2.contains(path)) {
			getLog().info(MessageFormat.format(Messages.InitializeMojo_0, path));
			this.session.getCurrentProject().addCompileSourceRoot(path);
		} else {
			getLog().info(MessageFormat.format(Messages.InitializeMojo_1, path));
		}
	}
1354692
def CompileFilesRelative(self):
        
        return (os.path.relpath(path, self.ProjectHome) for path in sorted(self.CompileFiles, key=self.lower))
1174480
function(relativePath) {
    const folder = setupHelper.setupFolderAbsolutePath() + '/' + relativePath;
    return setupHelper.handleShellResponse(shell.exec('rm -rf ' + folder));
  }
828686
def relative_path path
      require 'pathname'

      full_path = Pathname.new(path).realpath             # /full/path/to/project/where/is/file.extension
      base_path = Pathname.new(source_directory).realpath # /full/path/to/project/

      full_path.relative_path_from(base_path).to_s        # where/is/file.extension
    end
887972
@Override
    protected List<ChecksumFile> getFilesToProcess()
    {
        List<ChecksumFile> files = new LinkedList<ChecksumFile>();

        // Add project main artifact.
        if ( hasValidFile( project.getArtifact() ) )
        {
            files.add( new ChecksumFile( "", project.getArtifact().getFile(), project.getArtifact().getType(),null ) );
        }

        // Add projects attached.
        if ( project.getAttachedArtifacts() != null )
        {
            for ( Artifact artifact : (List<Artifact>) project.getAttachedArtifacts() )
            {
                if ( hasValidFile( artifact ) )
                {
                    files.add( new ChecksumFile( "", artifact.getFile(), artifact.getType(), artifact.getClassifier() ) );
                }
            }
        }
        return files;
    }
1099800
private String src()
    {

        // Deal with a direct context-relative page that has been specified
        if (_page != null) {
            HttpServletRequest request = (HttpServletRequest) pageContext.getRequest();
            ModuleConfig config = (ModuleConfig) request.getAttribute(Globals.MODULE_KEY);
            if (config == null)
                return (request.getContextPath() + _page);
            return (request.getContextPath() + config.getPrefix() + _page);
        }

        // Deal with an absolute source that has been specified
        if (_state.src != null)
            return _state.src;
        return null;
    }
1283778
function (output) {
              // Manually convert paths to relative, because LESS
              // can make tose absolute for complex cases.
              var map = JSON.parse(output);
              var dir = path.dirname(context.pathname);
              map.sources.forEach(function (file, idx) {
                var rel = path.relative(dir, file);
                if (path.sep === '\\') { rel = rel.replace('\\', '/'); }
                map.sources[idx] = rel;
              });

              self.map = JSON.stringify(map);
            }