typelead / gradle-eta

Gradle plugin for the Eta programming language
BSD 3-Clause "New" or "Revised" License
30 stars 7 forks source link

Application scaffold :run fails with 'Error: Could not find or load main class eta.main' #24

Closed carymrobbins closed 6 years ago

carymrobbins commented 6 years ago

We get the following error when attempting to run a scaffolded project (via IntelliJ) with the gradle :run task.

Error: Could not find or load main class eta.main

This sounds like dependencies are not getting properly added.

./settings.gradle

rootProject.name = 'hahaha'

./build.gradle

plugins {
    id 'com.typelead.eta' version '0.7.2'
    id 'application'
}

group 'haha'
version '1.0-SNAPSHOT'

eta {
  version = '0.8.0b2'
  etlasVersion = '1.4.0.0'
}

dependencies {
    compile eta('base:4.8.2.0')
}

./src/main/eta/Main.hs

module Main where

main = putStrLn "hello from intellij + gradle + eta!"
rahulmutt commented 6 years ago

I was able to reproduce this - it looks like the class path is being sent to java is not the new versioned classpath scheme we've setup.

rahulmutt commented 6 years ago

The issue was completely different actually:

version '1.0-SNAPSHOT'

This will get translated to underlying Etlas package version 1.0-SNAPSHOT which ends up behaving weird inside of Etlas somewhere, causing the expected output file path to be invalid. I think the best naming scheme is to just parse the longest numeric + dot sequence and make that the default.

If you make it version: '1.0', it should work.

rahulmutt commented 6 years ago

Released v0.7.3 to fix exactly this.