Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does cpd4sbt support multiple languages on the same project? #14

Open
NikolaySl opened this issue Aug 26, 2016 · 0 comments
Open

Does cpd4sbt support multiple languages on the same project? #14

NikolaySl opened this issue Aug 26, 2016 · 0 comments

Comments

@NikolaySl
Copy link

In version 1.1.5 it was possible to add multi-language support by:

val cpdJava = TaskKey[Unit]("cpdJava", "CPD for java")

lazy val prj = (project in file("."))
  .settings(
     // ....
    // CPD for Scala sources
    CopyPasteDetector.cpdSettings,    
    cpdMinimumTokens := 75,
    cpdTargetPath := target.value,
    cpdReportName := "cpd-scala-report.xml",
    cpdLanguage := Language.Scala,

    // CPD for Java sources
    cpdJava <<= (cpdReportSettings, cpdSourceSettings, cpdMaxMemoryInMB, cpdClasspath, streams) map {
      (report, settings, mem, path, streams) => cpdAction(
        report.copy(name = "cpd-java-report.xml"),
        // TODO: remove or adjust minTokens.
        settings.copy(language = Language.Java, minTokens = 45),
        mem,
        path,
        streams
      )
    },

    // Run CPD for Java before CPD for Scala
    cpd <<= cpd dependsOn cpdJava,
   // ....
}

How it can be done in 1.2.0 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant