<commit_before>package codeOrchestra.colt.as.model

import codeOrchestra.colt.core.model.Project
import codeOrchestra.colt.core.model.ProjectPaths
import codeOrchestra.colt.core.model.monitor.ChangingMonitor
import codeOrchestra.colt.core.ui.components.fileset.FilesetInput
import codeOrchestra.groovyfx.FXBindable
import codeOrchestra.util.PathUtils
import groovy.transform.Canonical

/**
 * @author <NAME>
 */
@Canonical
@FXBindable
class AsProjectPaths extends ProjectPaths<AsProject> {
    String sources = "src/"
    String libraries = "lib/"
    String assets = "assets/"

    String htmlTemplatePath = ""

    AsProjectPaths() {
        ChangingMonitor monitor = ChangingMonitor.instance
        monitor.addAll(sources(),
                libraries(),
                assets(),
                htmlTemplatePath())
    }

    public String getHTMLTemplatePath() {
        return htmlTemplatePath
    }

    public addSources(String[] value) {
        sources = FilesetInput.createFilesetString(value.collect{new File(it)})
    }

    public addLibraries(String[] value) {
        libraries = FilesetInput.createFilesetString(value.collect{new File(it)})
    }

    public addAssets(String[] value) {
        assets = FilesetInput.createFilesetString(value.collect{new File(it)})
    }

    public List<String> getSourcePaths() {
        return FilesetInput.getDirectoriesFromString(sources).collect{it.path}
    }

    public List<String> getLibraryPaths() {
        return FilesetInput.getFilesFromString(libraries).collect{it.path}
    }

    public List<String> getAssetPaths() {
        return FilesetInput.getDirectoriesFromString(assets).collect{it.path}
    }

    @Override
    Closure buildXml(Project project) {
        return {
            'sources-set' (sources)<commit_msg>Libraries files pattern fix<commit_after>package codeOrchestra.colt.as.model

import codeOrchestra.colt.core.model.Project
import codeOrchestra.colt.core.model.ProjectPaths
import codeOrchestra.colt.core.model.monitor.ChangingMonitor
import codeOrchestra.colt.core.ui.components.fileset.FilesetInput
import codeOrchestra.groovyfx.FXBindable
import codeOrchestra.util.PathUtils
import groovy.transform.Canonical

/**
 * @author <NAME>
 */
@Canonical
@FXBindable
class AsProjectPaths extends ProjectPaths<AsProject> {
    String sources = "src/"
    String libraries = "lib/"
    String assets = "assets/"

    String htmlTemplatePath = ""

    AsProjectPaths() {
        ChangingMonitor monitor = ChangingMonitor.instance
        monitor.addAll(sources(),
                libraries(),
                assets(),
                htmlTemplatePath())
    }

    public String getHTMLTemplatePath() {
        return htmlTemplatePath
    }

    public addSources(String[] value) {
        sources = FilesetInput.createFilesetString(value.collect{new File(it)})
    }

    public addLibraries(String[] value) {
        libraries = FilesetInput.createFilesetString(value.collect{new File(it)})
    }

    public addAssets(String[] value) {
        assets = FilesetInput.createFilesetString(value.collect{new File(it)})
    }

    public List<String> getSourcePaths() {
        return FilesetInput.getDirectoriesFromString(sources).collect{it.path}
    }

    public List<String> getLibraryPaths() {
        return FilesetInput.getFilesFromString(libraries).collect{it.path}.findAll {it.matches(/(?i).*\.(swc|ane)$/)}
    }

    public List<String> getAssetPaths() {
        return FilesetInput.getDirectoriesFromString(assets).collect{it.path}
    }

    @Override
    Closure buildXml(Project project) {
        return {
            'sources-set' (sources)
{'fraction_non_alphanumeric': 0.10305028854080792, 'fraction_numerical': 0.0, 'mean_word_length': 3.3645083932853717, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5522409', 'n_tokens_mistral': 1057, 'n_tokens_neox': 1027, 'n_words': 179}