Git Product home page Git Product logo

gr8's People

Contributors

gabrielittner avatar goooler avatar madisp avatar martinbonnin avatar msfjarvis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gr8's Issues

Applying to multi module project

I'm trying to use this plugin for https://github.com/littlerobots/version-catalog-update-plugin. That project has a plugin module and a separate module containing some logic around the version catalogs.

Following the README I've setup the plugin like this:

def shadeConfiguration = configurations.create("shade")

gr8 {
    def shadowedJar = create("gr8") {
        proguardFile("rules.pro")
        configuration("shade")
    }
    // Replace the regular jar with the shadowed one in the publication
    replaceOutgoingJar(shadowedJar)

    // Make the shadowed dependencies available during compilation/tests
    configurations.named("compileOnly").configure {
        extendsFrom(shadeConfiguration)
    }
    configurations.named("testImplementation").configure {
        extendsFrom(shadeConfiguration)
    }
}

repositories {
    gradlePluginPortal()
}

dependencies {
    shade project(":catalog")
    compileOnly("dev.gradleplugins:gradle-api:7.3.2")
    shade "org.jetbrains.kotlin:kotlin-stdlib:1.4"
    shade "com.fasterxml.jackson.dataformat:jackson-dataformat-toml:2.13.0"
    shade "com.squareup.moshi:moshi:1.12.0"
    shade "com.squareup.moshi:moshi-kotlin:1.12.0"
    testImplementation 'junit:junit:4.13.2'
    testImplementation 'com.github.ben-manes:gradle-versions-plugin:0.40.0'
    testImplementation(gradleTestKit())
    compileOnly 'com.github.ben-manes:gradle-versions-plugin:0.40.0'
}

It seems that I have to add the catalog module to the shade configuration too, otherwise none of the classes from that module appear to be added to the plugin jar. But this introduces an issue where I can no longer run my tests; classes from that project are not found in testKit tests, even when testImplementation is extending the shade config.

I'm also not sure if I really need to redeclare the dependencies that that module uses here in the shade config. It also seems that not all of the kotlin classes are relocated in the gr8 jar so that also seems to point to more configuration / user errors ๐Ÿ˜„

Can you point me in the right direction?

StripGradleApiTask.isGradleApi also matches AGP

I wanted to add all of compileOnly to classpathConfiguration to get rid of R8 warnings about missing classes. However that fails with:

Could not determine the dependencies of task ':plugin:gr8StripGradleApi'.
> Failed to query the value of task ':plugin:gr8StripGradleApi' property 'gradleApiJar$plugin_common'.
   > Collection contains more than one matching element.

When I printed all files in the configurationthe configuration I found this:

.../.gradle/caches/modules-2/files-2.1/dev.gradleplugins/gradle-api/8.0.2/81ef2cba43a0896316935ece786174490ea30758/gradle-api-8.0.2.jar
.../.gradle/caches/modules-2/files-2.1/com.android.tools.build/gradle-api/7.4.2/5f81693f719b0472898c69dafb42befbb18de887/gradle-api-7.4.2.jar

Not sure if this is possible to avoid just based on the path. Maybe it could be possible to have more than one classpathConfiguration and make it configurable which ones are stripped.

Relocate without shrinkning

Hi,

I want to relocate AWS SDK for https://github.com/burrunan/gradle-s3-build-cache, and it looks like proguard is either "relocate+obfuscate" or "just keep old package names".

What I want is to just relocate packages under com.github.burrunan.s3cache.relocated package, and I don't want all the classes to be renamed as a.class so the stacktraces are understandable.

Do you know if there's a proguard configuration for that?

It looks like -keep would keep the original names (which would defeat the purpose of shading as it would conflict with other dependencies), however, -flattenpackagehierarchy and -repackageclasses obfuscate the names.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.