bat-cha / gradle-plugin-git-dependencies

A Gradle Plugin to manage git repository dependencies
http://bat-cha.github.io/gradle-plugin-git-dependencies/
152 stars 24 forks source link

Required Git Project Structure #24

Open Syzygy2048 opened 10 years ago

Syzygy2048 commented 10 years ago

I'm having an issue with most git repositories I want to use. They don't adher to the structure that seems to be required by this plugin, that is the root/build.gradle file has to be within the root folder of the repository, like it's done in the org.batcha:dummy-project-a:4.2 example project, instead the structure is like this: root/libname/build.gradle as in https://github.com/adjust/android_sdk. The error I'm getting is: "Gradle wrapper not found in ..\MyProject\build\git-dependencies\Adjust ! The dependency won't be installed to your local repository" All required files are in ..\MyProject\build\git-dependencies\Adjust\Adjust.

Is there a way to specify which folder of the repository the relevant files are in that I've overlooked (maybe through gradle itself? admitedly I'm not very experienced with that) or was this not considered? If this is missing, would it be possible to add a way to specificy local path within the repository?

I'm using version 0.1 of the plugin from maven central because I get the following error with 0.2: Error:Cause: com.google.common.io.Closeables.closeQuietly(Ljava/io/Closeable;)V this seems to be caused by a missing guava (17.0+), but trying to include that, even before this plugin, doesn't help me.

The relevant parts of my main build.gradle file looks like this:

apply plugin: 'git-dependencies'
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.9.+'

        //classpath 'com.google.guava:guava:17.0'
        //classpath 'org.batcha.gradle.plugins:git-dependencies:0.2' // produces an error
        classpath 'org.batcha.gradle.plugins:git-dependencies:0.1'
    }
}

repositories {
    mavenCentral()
}

dependencies {
    compile('com.adjust:Adjust:v3.3.2').ext.git = 'https://github.com/adjust/android_sdk.git'
}

Perhaps there's a possibility to define a path similar to my not yet managed dependencies: build.gradle:

dependencies {
    compile project(':Adjust')
}

settings.gradle:

include ':Adjust'
project(':Adjust').projectDir = new File(settingsDir, '../MyProject/build/git-dependencies/Adjust/Adjust')