diff options
| -rw-r--r-- | build.sbt | 24 | ||||
| -rw-r--r-- | scalastyle-config.xml | 2 | ||||
| -rw-r--r-- | scalastyle-test-config.xml | 4 |
3 files changed, 16 insertions, 14 deletions
@@ -43,6 +43,7 @@ lazy val commonSettings = Seq ( scalacOptions := Seq("-deprecation", "-feature") ++ scalacOptionsVersion(scalaVersion.value), libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value, addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.0" cross CrossVersion.full), + (scalastyleConfig in Test) := (baseDirectory in root).value / "scalastyle-test-config.xml", // Use the root project's unmanaged base for all sub-projects. unmanagedBase := (unmanagedBase in root).value, // Since we want to examine the classpath to determine if a dependency on firrtl is required, @@ -120,11 +121,13 @@ lazy val chiselSettings = Seq ( lazy val coreMacros = (project in file("coreMacros")). settings(commonSettings: _*). - settings(publishArtifact := false) + // Prevent separate JARs from being generated for coreMacros. + settings(skip in publish := true) lazy val chiselFrontend = (project in file("chiselFrontend")). settings(commonSettings: _*). - settings(publishArtifact := false). + // Prevent separate JARs from being generated for chiselFrontend. + settings(skip in publish := true). settings( scalacOptions := scalacOptions.value ++ Seq( "-deprecation", @@ -153,9 +156,15 @@ lazy val chisel = (project in file(".")). settings(commonSettings: _*). settings(chiselSettings: _*). settings(publishSettings: _*). - // Prevent separate JARs from being generated for coreMacros and chiselFrontend. dependsOn(coreMacros % "compile-internal;test-internal"). dependsOn(chiselFrontend % "compile-internal;test-internal"). + // We used to have to disable aggregation in general in order to suppress + // creation of subproject JARs (coreMacros and chiselFrontend) during publishing. + // This had the unfortunate side-effect of suppressing coverage tests and scaladoc generation in subprojects. + // The "skip in publish := true" setting in subproject settings seems to be + // sufficient to suppress subproject JAR creation, so we can restore + // general aggregation, and thus get coverage tests and scaladoc for subprojects. + aggregate(coreMacros, chiselFrontend). settings( scalacOptions in Test ++= Seq("-language:reflectiveCalls"), scalacOptions in Compile in doc ++= Seq( @@ -167,14 +176,7 @@ lazy val chisel = (project in file(".")). "-doc-title", name.value, "-doc-root-content", baseDirectory.value+"/root-doc.txt" ), - // Disable aggregation in general, but enable it for specific tasks. - // Otherwise we get separate Jar files for each subproject and we - // go to great pains to package all chisel3 core code in a single Jar. - // If you get errors indicating coverageReport is undefined, be sure - // you have sbt-scoverage in project/plugins.sbt - aggregate := false, - aggregate in coverageReport := true, - // Include macro classes, resources, and sources main JAR. + // Include macro classes, resources, and sources main JAR since we don't create subproject JARs. mappings in (Compile, packageBin) ++= (mappings in (coreMacros, Compile, packageBin)).value, mappings in (Compile, packageSrc) ++= (mappings in (coreMacros, Compile, packageSrc)).value, mappings in (Compile, packageBin) ++= (mappings in (chiselFrontend, Compile, packageBin)).value, diff --git a/scalastyle-config.xml b/scalastyle-config.xml index e12da8c2..67aa8afe 100644 --- a/scalastyle-config.xml +++ b/scalastyle-config.xml @@ -95,7 +95,7 @@ </check> <check level="warning" class="org.scalastyle.scalariform.MethodNamesChecker" enabled="true"> <parameters> - <parameter name="regex"><![CDATA[^[a-z][A-Za-z0-9]*$]]></parameter> + <parameter name="regex"><![CDATA[^[a-z][A-Za-z0-9_]*(_=)?$]]></parameter> <parameter name="ignoreRegex"><![CDATA[^(\+[&%]?|\-[&%]?|\*|/|%|&|\||\^|<|>|\|\||&&|:=|<>|<=|>=|!=|===|=/=|<<|>>|##|unary_(~|\-%?|!))$]]></parameter> </parameters> </check> diff --git a/scalastyle-test-config.xml b/scalastyle-test-config.xml index bf32aacd..50953819 100644 --- a/scalastyle-test-config.xml +++ b/scalastyle-test-config.xml @@ -94,8 +94,8 @@ </check> <check level="warning" class="org.scalastyle.scalariform.MethodNamesChecker" enabled="true"> <parameters> - <parameter name="regex"><![CDATA[^[a-z][A-Za-z0-9]*$]]></parameter> - <parameter name="ignoreRegex"><![CDATA[^(\+[&%]?|\-[&%]?|\*|/|%|&|\||\^|<|>|\|\||&&|:=|<>|<=|>=|!=|===|<<|>>|##|unary_(~|\-%?|!))$]]></parameter> + <parameter name="regex"><![CDATA[^[a-z][A-Za-z0-9_]*(_=)?$]]></parameter> + <parameter name="ignoreRegex"><![CDATA[^(\+[&%]?|\-[&%]?|\*|/|%|&|\||\^|<|>|\|\||&&|:=|<>|<=|>=|!=|===|=/=|<<|>>|##|unary_(~|\-%?|!))$]]></parameter> </parameters> </check> <check level="warning" class="org.scalastyle.scalariform.NumberOfMethodsInTypeChecker" enabled="true"> |
