Frege / frege-gradle-plugin

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

compileFrege task doesn't execute Frege compiler #38

Open russel opened 8 years ago

russel commented 8 years ago

On Debian Sid, using JDK8 from packages (or JDK9 download), with the build.gradle file:

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

apply plugin: 'application'

repositories {
  jcenter()
  mavenCentral()
}

dependencies {
  compile 'org.frege-lang:frege:3.24.+'
}

mainClassName = 'uk.org.russel.jaxlondon2016.HelloWorld'

defaultTasks 'run'

on the project that looks like:

.
├── build.gradle
├── gradle
│   └── wrapper
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── settings.gradle
└── src
    └── main
        └── frege
            └── uk
                └── org
                    └── russel
                        └── jaxlondon2016
                            └── HelloWorld.fr

with the Frege file being:

{-|
Module : uk.org.russel.jaxlondon2016.HelloWorld
Description : The (in)famous 'Hello World' program in Haskell.
Copyright : © 2016  Russel Winder
License : GPLv3
Maintainer : russel@winder.org.uk
Stability :  stable
Portability :  portable

This module contains an implementation of the 'Hello World' program first introduced to the world in
"The C Programming Language" by Brian Kernighan and Dennis Ritchie.

This is definitely Frege code and not Haskell code since we are using the Frege specific `println` function
(which is just `System.out.println` from the Java Platform) in preference to Haskell's `putStrLn`. `putStrLn`
would work equally well on Frege.
-}
module uk.org.russel.jaxlondon2016.HelloWorld where

-- | The Hello World program in Frege (Haskell)
main args = println "Hello World."

the result of an execution is:

|> ./gradlew build
:compileJava UP-TO-DATE
:compileFrege
Error: Could not find or load main class frege.compiler.Main
:compileFrege FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileFrege'.
> Process 'command '/home/users/russel/lib.Linux.x86_64/jdk-9_135/bin/java'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 3.85 secs
russel commented 8 years ago

A bit more data. I completely removed the entire Gradle cache (at the risk of downloading half the Internet again :-). I did a clean first and it downloaded lots of Frege bits and pieces including the frege jar the plugin uses. When I then asked for a build:

|> ./gradlew classes
:compileJava UP-TO-DATE
:compileFrege
Download https://jcenter.bintray.com/org/frege-lang/frege/3.24.100.1/frege-3.24.100.1.pom
Error: Could not find or load main class frege.compiler.Main
:compileFrege FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileFrege'.
> Process 'command '/home/users/russel/lib.Linux.x86_64/jdk-9_137/bin/java'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 4.206 secs

So although the POM for the Frege jar was downloaded, the actual jar was not. I am not sure this is manually hackable?

russel commented 8 years ago

More data. Using:

dependencies {
  compile 'org.frege-lang:frege:3.23.+'
}

with JDK8 (but not JDK9 since that is never going to work) works fine. So I suspect that there is a problem with the Frege 3.24 artefact and it's POM. Everything also works if I manually download the Frege 3.24.100.1 artefact:

dependencies {
  compile files(System.properties['user.home']+ '/lib/JDK/frege.jar')
}
Dierk commented 8 years ago

It could be that the version range "+" does not work nicely with the 100.1 scheme.

Dierk

sent from:mobile

Am 26.09.2016 um 19:44 schrieb Russel Winder notifications@github.com:

More data. Using:

dependencies { compile 'org.frege-lang:frege:3.23.+' } with JDK8 (but not JDK9 since that is never going to work) works fine. So I suspect that there is a problem with the Frege 3.24 artefact and it's POM. Everything also works if I manually download the Frege 3.24.100.1 artefact:

dependencies { compile files(System.properties['user.home']+ '/lib/JDK/frege.jar') } — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

breskeby commented 8 years ago

The problem is that the packaging declaration in the pom has changed. In 3.23.422-ga05a487 the packaging is declared as bundle. In frege-3.24.100.1 the packaging in the pom is declared as pom. That means that gradle won't download any jar here. Checking the published repository it seems something went wrong as there is no jar published at https://jcenter.bintray.com/org/frege-lang/frege/3.24.100.1/

russel commented 8 years ago

Seems like a 3.24.100.2 release should be able to fix everything.