Skip to content

Plugin picks up all files in the source/test folders #103

Description

@lkonstantinov

I know the intention is to pick up only *.clj and *.cljc, but this code in NamespaceDiscovery.java:

    scanner.addSourceMapping(new SuffixMapping(".clj", new HashSet(Arrays.asList(".clj", "__init.class"))));
    scanner.addSourceMapping(new SuffixMapping(".cljc", new HashSet(Arrays.asList(".cljc", "__init.class"))));

only affects the StaleSourceScanner implementation. The SimpleSourceInclusionScanner needs to have the inclusion/exclusion collections initialized on construction - so, something like this:

  protected SourceInclusionScanner getSourceInclusionScanner(boolean includeStale) {
    return includeStale ? new SimpleSourceInclusionScanner(Sets.newHashSet("**/*.clj", "**/*.cljc"),
                                                           Collections.EMPTY_SET) : new StaleSourceScanner(1024);
  }

Without the fix the plugin is trying to compile any files it finds in the source directories (.cljs in my case) failing the whole build.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions