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

Source directories are not detected by Netbeans #22

Open
januslynd opened this issue Sep 20, 2015 · 1 comment
Open

Source directories are not detected by Netbeans #22

januslynd opened this issue Sep 20, 2015 · 1 comment

Comments

@januslynd
Copy link

Hi I'm testing the gradle plugin, and when importing the project into Netbeans 8.0.2 / 8.1 it doesn't recognizes Frege sources ("src/main/frege").

I've look into the SourceSet branch you are working on and I guess the problem is that there is no frege sourceSet defined. It seems you are adding the dir to all existent source sets declared by the JavaPlugin.

As a work around it turns out if you add the srcDir to the allSource sourceSet then the IDE knows that an extra source dir should be taken into account and then it is visible.

Inside the FregePlugin#configureSourceSetDefaults fmethod it's enough adding the last line:

  private void configureSourceSetDefaults(JavaBasePlugin javaBasePlugin) {
        project.convention.getPlugin(JavaPluginConvention).sourceSets.all { sourceSet ->
            def fregeSourceSet = new FregeSourceSet(sourceSet.displayName, fileResolver)
            new DslObject(sourceSet).convention.plugins.put(FREGE_PLUGIN_NAME, fregeSourceSet)

            fregeSourceSet.frege.srcDir("src/${sourceSet.name}/frege")

            def compileTaskName = sourceSet.getCompileTaskName(FREGE_PLUGIN_NAME)

            def fregeCompile = project.tasks.create(compileTaskName, FregeTask)
            javaBasePlugin.configureForSourceSet(sourceSet, fregeCompile)
            fregeCompile.dependsOn(sourceSet.compileJavaTaskName)
            fregeCompile.setDescription("Compiles the ${sourceSet.name} Frege sources.")
            fregeCompile.setSource(fregeSourceSet.frege)

            project.tasks.getByName(sourceSet.classesTaskName).dependsOn(compileTaskName)

            // WORKAROUND
            sourceSet.allSource.srcDir("src/${sourceSet.name}/frege")
        }
    }

Janus

@Dierk
Copy link
Member

Dierk commented Sep 20, 2015

Ok, thanks!

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

2 participants