palantir / gradle-miniconda-plugin

Plugin that sets up a Python environment for building and running tests using Miniconda.
Apache License 2.0
13 stars 19 forks source link

Ambiguous method overloading for method java.io.File#<init>. #23

Closed vikramkone closed 8 years ago

vikramkone commented 8 years ago

Getting this error when I do gradle build

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':monit'.
> Ambiguous method overloading for method java.io.File#<init>.
Cannot resolve which method to invoke for [null, null] due to overlapping prototypes between:
        [class java.lang.String, class java.lang.String]
        [class java.lang.String, class java.io.File]
        [class java.io.File, class java.lang.String]

* 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: 6.818 secs

This is my build script

apply plugin: "com.palantir.python.miniconda"

buildscript {
    repositories {
        maven {
            url "https://plugins.gradle.org/m2/"
        }
    }
    dependencies {
        classpath "gradle.plugin.com.palantir.python:gradle-miniconda-plugin:0.4.0"
    }
}
mnazbro commented 8 years ago

@vikramkone This build script doesn't look valid because the plugin application is happening before the buildscript, but let's assume you put it after the buildscript.

Did you add a miniconda block?

PeterLappo commented 8 years ago

I had the same problem which was resolved when I added a block like this

miniconda {
    bootstrapDirectoryPrefix = new File(System.getProperty('user.home'), '.miniconda')
    buildEnvironmentDirectory = new File(buildDir, 'python')
    minicondaVersion = '3.10.1'
    packages = ['python-notebook']
}
mnazbro commented 8 years ago

It looks like what this question is actually asking for is one of two things:

  1. Reasonable defaults for these required values
  2. Preventing setupPython and other Miniconda tasks from happening unless the miniconda block exists.
mnazbro commented 8 years ago

I'm much more willing to do the first solution since the second one leads to confusion about why adding the plugin doesn't work

mnazbro commented 8 years ago

Fixed by #27