PatilShreyas / compose-report-to-html

A utility (Gradle Plugin + CLI) to convert Jetpack Compose compiler metrics and reports to beautified HTML page.
https://patilshreyas.github.io/compose-report-to-html/
MIT License
383 stars 9 forks source link

Feature request: remove required m2 repositories #53

Closed leffsu closed 1 year ago

leffsu commented 1 year ago

Greetings!

We have a following problem in our company:

  1. We have a Nexus mirror which caches all dependencies downloaded by Android projects;
  2. We have a runner with no internet connection (it can only get data from Nexus);
  3. When building the project, the plugin demands downloading core package from m2;
  4. Build fails because it can't reach m2 maven repository.

Is there any way to remove a requirement of using m2 and other dependencies and get them from the host project instead?

PatilShreyas commented 1 year ago

@leffsu exactly which dependency is failing while fetching it from m2?

PatilShreyas commented 1 year ago

This is gonna be the tough problem to solve, but will definitely try to solve it.

leffsu commented 1 year ago

@PatilShreyas

FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':library'.
> Could not resolve all files for configuration ':library:classpath'.
   > Could not resolve dev.shreyaspatil.compose-compiler-report-generator:core:1.0.1.
     Required by:
         project :library > dev.shreyaspatil.compose-compiler-report-generator:dev.shreyaspatil.compose-compiler-report-generator.gradle.plugin:1.0.1 > dev.shreyaspatil.compose-compiler-report-generator:gradle-plugin:1.0.1
         project :library > dev.shreyaspatil.compose-compiler-report-generator:dev.shreyaspatil.compose-compiler-report-generator.gradle.plugin:1.0.1 > dev.shreyaspatil.compose-compiler-report-generator:gradle-plugin:1.0.1 > dev.shreyaspatil.compose-compiler-report-generator:report-generator:1.0.1
      > Could not resolve dev.shreyaspatil.compose-compiler-report-generator:core:1.0.1.
         > Could not get resource 'https://plugins.gradle.org/m2/dev/shreyaspatil/compose-compiler-report-generator/core/1.0.1/core-1.0.1.pom'.
            > Could not GET 'https://jcenter.bintray.com/dev/shreyaspatil/compose-compiler-report-generator/core/1.0.1/core-1.0.1.pom'.
               > peer not authenticated
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org/
BUILD FAILED in 1m 2s

I guess you could supply us with a generator gradle plugin without dependencies to core in .pom file. Therefore, we'll be able to add it separately and make it pull the dependency from the Nexus.

Really appreciating your swiftness, keep rocking! :)

PatilShreyas commented 1 year ago

Thanks for sharing the error @leffsu

https://plugins.gradle.org/m2/ This is the repo URL through which Gradle Plugin is resolved.

leffsu commented 1 year ago

Yeah, it's unavailable from the runner. Would you kindly make a build for gradle without the core plugin? I will apply it separately

PatilShreyas commented 1 year ago

This "'core" is not a plugin but a Library. Can you please check why this dependency is not cached in your runner? It should be get resolved from mavenCentral but somehow not able to.

PatilShreyas commented 1 year ago

@leffsu Are you using the plugin as follows?

plugins {
  id("dev.shreyaspatil.compose-compiler-report-generator") version "1.0.1"
}

If yes, then remove this and apply the plugin using buildScript as follows:

buildscript {
  repositories {
    maven {
      url = uri("https://plugins.gradle.org/m2/")
    }
  }
  dependencies {
    classpath("dev.shreyaspatil.compose-compiler-report-generator:gradle-plugin:1.0.1")
  }
}

apply(plugin = "dev.shreyaspatil.compose-compiler-report-generator")

Please try this at you end and let me know if this fixes your issue or not.

PatilShreyas commented 1 year ago

Any update here @leffsu ?

leffsu commented 1 year ago

Hey, we just decided to build it locally. Thank you for the input!