Frege / frege-gradle-plugin

Gradle plugin for compiling Frege projects
BSD 3-Clause "New" or "Revised" License
25 stars 10 forks source link

Document how to fix "compiled for target 1.7" error #40

Open manuel-mauky opened 8 years ago

manuel-mauky commented 8 years ago

When running a small build script like this:

plugins {
    id "org.frege-lang" version "0.8"
}

apply plugin: "java"

dependencies {
    compile "org.frege-lang:frege:3.22.367-g2737683"
    compile "org.frege-lang:fregefx:0.3.1"
}

I get compile errors like this:

E <PATH>/examples/fregefx/src/main/frege/example/fregefx/HelloFrege.fr:7: cannot import fregefx.JavaFxUtils
    compiled for target  1.7 (without lambda support)
    when the current target  1.8 has lambda support
    Try to use compiler option -target 1.7
example.fregefx.HelloFrege: build failed because of compilation errors.

While the error somehow points out what's wrong, I had a hard time finding out how to solve this issue. It seems that there are other users too that have the same error, see https://github.com/Frege/frege/issues/275.

To fix this I've changed my build file like this:

plugins {
    id "org.frege-lang" version "0.8"
}

apply plugin: "java"

compileFrege {
    target = 1.7
}
compileTestFrege {
    target = 1.7
}

dependencies {
    compile "org.frege-lang:frege:3.22.367-g2737683"
    compile "org.frege-lang:fregefx:0.3.1"
}

To lower the hurdle for new users it would be super if this would be documented in the README file.

Dierk commented 8 years ago

True.

It is a bit of a temporary issue as long as we have the Java 7/8 split but we can certainly improve here.

Cheers Dierk

sent from:mobile

Am 30.09.2016 um 15:20 schrieb Manuel Mauky notifications@github.com:

When running a small build script like this:

plugins { id "org.frege-lang" version "0.8" }

apply plugin: "java"

dependencies { compile "org.frege-lang:frege:3.22.367-g2737683" compile "org.frege-lang:fregefx:0.3.1" } I get compile errors like this:

E /examples/fregefx/src/main/frege/example/fregefx/HelloFrege.fr:7: cannot import fregefx.JavaFxUtils compiled for target 1.7 (without lambda support) when the current target 1.8 has lambda support Try to use compiler option -target 1.7 example.fregefx.HelloFrege: build failed because of compilation errors. While the error somehow points out what's wrong, I had a hard time finding out how to solve this issue. It seems that there are other users too that have the same error, see Frege/frege#275.

To fix this I've changed my build file like this:

plugins { id "org.frege-lang" version "0.8" }

apply plugin: "java"

compileFrege { target = 1.7 } compileTestFrege { target = 1.7 }

dependencies { compile "org.frege-lang:frege:3.22.367-g2737683" compile "org.frege-lang:fregefx:0.3.1" } To lower the hurdle for new users it would be super if this would be documented in the README file.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.