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

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

Open
tmoschou opened this issue Feb 21, 2019 · 1 comment

Comments

@tmoschou
Copy link

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
Copy link
Author

The documentation says that scalor will remove the options in zincOptionsScala when it thinks it is the default, hence why explicitly targeting 1.8 is not working.

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