scalor-maven-plugin icon indicating copy to clipboard operation
scalor-maven-plugin copied to clipboard

Plugin thinks default target is 1.8, but is 1.6 when compiling for Scala 2.11.12

Open tmoschou opened this issue 6 years ago • 1 comments

This was a particularly difficult bug to work out.

Running scalac -help for 2.11.12 gives

-target:<target>                Target platform for object files. All JVM 1.5 targets are deprecated. (jvm-1.5,jvm-1.6,jvm-1.7,jvm-1.8) default:jvm-1.6

However scalor is reporting in target/scalor/scala-options-report.txt

...
-target
   description: Target platform for object files. All JVM 1.5 - 1.7 targets are deprecated. Choices: (jvm-1.5,jvm-1.6,jvm-1.7,jvm-1.8), default: jvm-1.8.
   syntax format: -target:<target>
   effective value: jvm-1.8
   user provided entry:

I have also tried manually specifying zincOptionsScala to no luck. (scalar reports default is 1.8)

My pom is as follows

<properties>
  <scala.zinc.version>1.1.1</scala.zinc.version>
  <scala.version>2.11.12</scala.version>
  <scala.plugin.macro.version>2.1.1<scala.plugin.macro.version>
</properties>
<plugin>
    <groupId>com.carrotgarden.maven</groupId>
    <artifactId>scalor-maven-plugin_2.12</artifactId>
    <version>1.4.2.20180508161326</version>
    <configuration>

        <!-- Required bridge. -->
        <defineBridge>
            <dependency>
                <groupId>org.scala-sbt</groupId>
                <artifactId>compiler-bridge_${scala.binary.version}</artifactId>
                <version>${scala.zinc.version}</version>
            </dependency>
        </defineBridge>

        <!-- Required compiler. -->
        <defineCompiler>
            <dependency>
                <groupId>org.scala-lang</groupId>
                <artifactId>scala-compiler</artifactId>
                <version>${scala.version}</version>
            </dependency>
        </defineCompiler>

        <!-- Optional compiler plugins. -->
        <definePluginList>
            <dependency>
                <groupId>org.scalamacros</groupId>
                <artifactId>paradise_${scala.version}</artifactId>
                <version>${scala.plugin.macro.version}</version>
            </dependency>
        </definePluginList>

        <zincLogActiveLevel>info</zincLogActiveLevel>

        <buildMainSourceScalaFolders>
            <source>${project.build.sourceDirectory}/../scala</source>
            <source>${project.build.directory}/generated-sources/avro</source>
        </buildMainSourceScalaFolders>

        <zincLogCompilerOptions>true</zincLogCompilerOptions>

    </configuration>
    <executions>
        <execution>
            <goals>

                <goal>register-main</goal>
                <goal>register-test</goal>

                <goal>compile-main</goal>
                <goal>compile-test</goal>

                <goal>scaladoc-main</goal>

            </goals>
        </execution>
    </executions>
</plugin>

tmoschou avatar Feb 21 '19 09:02 tmoschou