openjfx / javafx-gradle-plugin

Gradle plugin that makes it easy to work with JavaFX 11+
https://openjfx.io/
BSD 3-Clause "New" or "Revised" License
361 stars 62 forks source link

JavaFX not visible in subfolders? #77

Open dmaftule opened 4 years ago

dmaftule commented 4 years ago

Maybe this is not an actual issue, but here are the steps I followed. I'm using IntelliJ, JDK14, Gradle 6.4. I took your sample, which compiled and ran fine, and added another folder mm with a copy of HelloFX class (MyFile.java).

Screen Shot 2020-05-11 at 10 37 08 AM

I changed the gradle.build file to be:

plugins {
    id 'application'
    id 'org.openjfx.javafxplugin' version '0.0.8'
}

repositories {
    mavenCentral()
}

javafx {
    version = "14"
    modules = [ 'javafx.controls' ]
}

sourceSets {
    mm {
        compileClasspath += sourceSets.main.output
        runtimeClasspath += compileClasspath
        runtimeClasspath += sourceSets.main.output
        runtimeClasspath += sourceSets.main.compileClasspath
    }
}

mainClassName = 'HelloFX'

The build and run tasks for the project still work fine, just as before adding the extra folder.

However, when executing the compileMmJava task, I get errors:

Screen Shot 2020-05-11 at 10 41 02 AM

It looks like JavaFX is not visible for mm folder.

abhinayagarwal commented 4 years ago

Hi,

If you want to add a new sourceSet's src directory, the Java plugin has an easy way to achieve this:

sourceSets {
    main {
        java {
            srcDir 'src/mm/java'
        }
    }
}
Jugen commented 3 years ago

This is still a problem - can it be fixed ?