willir / cargo-ndk-android-gradle

Cargo NDK for Android projects
Apache License 2.0
55 stars 7 forks source link

Can't find cargo on Windows #9

Closed ndarilek closed 3 years ago

ndarilek commented 3 years ago

I'm looking at isFoundInPath, and it seems like you're looking for an exact match. I'm guessing you'd need to look for "cargo.exe" on Windows. I definitely have it in my path, and confirm that the plugin prints out its directory in the exception.

I'd submit a PR, but a) I'm not sure how to detect Windows in Gradle tasks and b) I can't seem to build my app against my checkout of the plugin. I set the dependency version to + and created a settings.gradle like this one. I.e.:

includeBuild('../../../../src/cargo-ndk-android-gradle') {
    dependencySubstitution {
        // As required.
        substitute module('gradle.plugin.com.github.willir.rust:plugin') with project(':plugin')
    }
}

But that didn't work. Advice welcome.

Thanks.

willir commented 3 years ago

Thanks a lot for reporting and for PR. Though, I've decided to test cargo present via running cargo --version, should be more reliable. Could you please check version 0.3.3?

P.S. To use local plugin you can:

1. build plugin

By running ./gradlew build from the plugin directory

2. find plugin jar file

In my case, it is ./plugin/build/libs/plugin-0.3.3.jar (from the plugin directory)

3. Use this jar

In your project, specify the full path to that jar file.

So, in build.gradle, instead of:

classpath "gradle.plugin.com.github.willir.rust:plugin:0.3.3"

write:

classpath files('/full/path/to/your/plugin/build/libs/plugin-0.3.3.jar')

I'm not sure where under Windows you need Windows or Linux path style. I guess you can just try

ndarilek commented 3 years ago

Works fine. Thanks!