mdietrichstein / gradle-offline-dependencies-plugin

Store project dependencies alongside your code for reproducible offline builds
Apache License 2.0
85 stars 28 forks source link

Does not work for buildscript dependencies in script plugins #13

Open winterDroid opened 6 years ago

winterDroid commented 6 years ago

Hey!

Great plugin. I recognized that dependencies defined in the buildscript of script plugins are not fetched. Example:

# plugin.gradle

buildscript {
    repositories { ... }
    dependencies {
        classpath "com.test:testdep:1.0.0"
    }
}

apply plugin: "testplugin"
# build.gradle
buildscript {
  repositories {
    maven {
      url 'https://plugins.gradle.org/m2/'
    }
  }
  dependencies {
    classpath 'gradle.plugin.io.pry.gradle.offline_dependencies:gradle-offline-dependencies-plugin:0.3'
  }
}

apply from: "plugin.gradle"
apply plugin: 'io.pry.gradle.offline_dependencies'

In that case the com.test:testdep:1.0.0" dependency won't be fetched. As a workaround I can add it to thebuild.gradle` dependencies.

mandrachek commented 6 years ago

Downloading of buildscript dependencies is addressed in the readme: https://github.com/mdietrichstein/gradle-offline-dependencies-plugin#handling-buildscript-dependencies

jaredchenkin commented 2 years ago

I'm going to jump on this because it's somewhat related to an issue i'm seeing - lmk if you want me to open a separate one.

I'm also having a hard time getting plugins pulled into the offline repository even though I am following the instructions on handling buildscript dependencies. I have a custom plugin that i've written that I'm trying to get pulled in but it isn't loading. It looks like what's happening is that the offline-dependencies plugin isn't pulling the gradle plugin marker artifact from the local cache, just the actual plugin itself. When I try to build the project using only the offline repository, it doesn't find my plugin even though the plugin jar/pom are in the offline repository. Thoughts?