r-cohen / unused-dep Goto Github PK
View Code? Open in Web Editor NEWDetects unused dependencies in Android gradle projects
Detects unused dependencies in Android gradle projects
Please make this great tool ready for kotlin support.
I tried using this tool in a multi module android project. I intentionally put a few dependency which I am not using in the build.gradle file but it reported
NO UNUSED DEPENDENCIES FOUND FOR GRADLE TASK :samplesdkapp:assembleDebug:
I tried to use but it seems to me that it stays in infinite loop, after two hours still doing the same.
This will attempt to run the `:fanatics:assembleDebug` gradle task for each dependency removal.
You can override the gradle task by using the `-gradletask` command line option. See `-help` for more options.
Proceed? (y/n)
y
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.reflection.CachedClass$3$1 (file:/Users/extmkv/StudioProjects/xxx/unused-dep.jar) to method java.lang.Object.finalize()
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass$3$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Processing /Users/extmkv/StudioProjects/xxx/error-handling/build.gradle ...
|_ this.implementation(this.project(:example-client))
running :example:assembleDebug
|_ this.implementation(this.project(:example-core))
running :example:assembleDebug
|_ this.implementation(this.project(:example-ui))
running :example:assembleDebug
...
...
...
same```
Please provide a feature to filter dependencies to avoid processing them.
For example:
java -jar unused-dep.jar -gradletask :app:assembleDebug 'implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:xyz"'
or
java -jar unused-dep.jar -gradletask :app:assembleDebug "org.jetbrains.kotlin:kotlin-stdlib-jdk8:xyz"
I can't find it in the repo.
https://github.com/r-cohen/unused-dep/search?q=unused-dep.jar&unscoped_q=unused-dep.jar
The command
./java -jar unused-dep.jar -gradletask :app:assembleDebug
does not work (for me).
It seems that the gradle task wasnt executed and the above command runs very quickly in the terminal. My build-directory of my app is empty.
Can you help me, please:)?
This will attempt to run the :app:assembleDebug
gradle task for each dependency removal.
You can override the gradle task by using the -gradletask
command line option. See -help
for more options.
Proceed? (y/n)
y
WARNING: An illegal reflective access operation has occurred
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.reflection.CachedClass$3$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Processing /Users/USER/JOZ/Development/apps/github/sports/kick_analyzer/app/build.gradle ...
| this.implementation(org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion)
running :app:assembleDebug
|_ this.implementation(this.project(:kickApi))
running :app:assembleDebug
|_ this.implementation(this.project(:kickAnalyzer))
running :app:assembleDebug
|_ this.implementation(this.project(:kickDatabase))
running :app:assembleDebug
|_ this.implementation(com.github.PhilJay:MPAndroidChart:v3.1.0)
running :app:assembleDebug
|_ this.implementation(com.ramijemli.percentagechartview:percentagechartview:0.3.0)
running :app:assembleDebug
|_ this.implementation(androidx.appcompat:appcompat:1.0.0)
running :app:assembleDebug
|_ this.implementation(com.google.android.material:material:1.0.0)
running :app:assembleDebug
|_ this.implementation(com.squareup.retrofit2:retrofit:$retrofitVersion)
running :app:assembleDebug
|_ this.implementation(com.squareup.retrofit2:converter-gson:$gsonVersion)
running :app:assembleDebug
|_ this.implementation(com.github.ChuckerTeam.Chucker:library:3.0.1)
running :app:assembleDebug
|_ this.implementation(org.koin:koin-android:$koinVersion)
running :app:assembleDebug
|_ this.implementation(io.reactivex.rxjava2:rxandroid:2.1.1)
running :app:assembleDebug
|_ this.implementation(io.reactivex.rxjava2:rxjava:2.2.7)
running :app:assembleDebug
|_ commonDependencies[testImplementation].each({ -> ... })
running :app:assembleDebug
|_ this.androidTestImplementation(com.squareup.spoon:spoon-client:2.0.0-SNAPSHOT)
running :app:assembleDebug
|_ this.androidTestImplementation(com.schibsted.spain:barista:3.2.0)
running :app:assembleDebug
|_ this.androidTestImplementation(com.azimolabs.conditionwatcher:conditionwatcher:0.2)
running :app:assembleDebug
|_ this.androidTestImplementation(com.squareup.retrofit2:converter-gson:$gsonVersion)
running :app:assembleDebug
|_ this.androidTestImplementation(org.koin:koin-test:$koinVersion)
running :app:assembleDebug
Processing /Users/USER/JOZ/Development/apps/github/sports/kick_analyzer/kickApi/build.gradle ...
| this.implementation(org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion)
running :app:assembleDebug
|_ commonDependencies.testImplementation.each({ -> ... })
running :app:assembleDebug
Processing /Users/USER/JOZ/Development/apps/github/sports/kick_analyzer/kickApi/coverage_rules.gradle ...
Processing /Users/USER/JOZ/Development/apps/github/sports/kick_analyzer/kickAnalyzer/build.gradle ...
| this.implementation(this.project(:kickApi))
running :app:assembleDebug
| this.implementation(org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion)
running :app:assembleDebug
|_ this.implementation(com.squareup.retrofit2:retrofit:$retrofitVersion)
running :app:assembleDebug
|_ this.implementation(com.squareup.retrofit2:converter-gson:$gsonVersion)
running :app:assembleDebug
|_ this.implementation(io.reactivex.rxjava2:rxjava:2.2.6)
running :app:assembleDebug
|_ commonDependencies.testImplementation.each({ -> ... })
running :app:assembleDebug
Processing /Users/USER/JOZ/Development/apps/github/sports/kick_analyzer/kickAnalyzer/coverage_rules.gradle ...
Processing /Users/USER/JOZ/Development/apps/github/sports/kick_analyzer/gradle/dependencies.gradle ...
Processing /Users/USER/JOZ/Development/apps/github/sports/kick_analyzer/kickDatabase/build.gradle ...
| this.implementation(this.project(:kickApi))
running :app:assembleDebug
| this.implementation(org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion)
running :app:assembleDebug
| this.implementation(androidx.room:room-runtime:2.2.3)
running :app:assembleDebug
|_ this.kapt(androidx.room:room-compiler:2.2.3)
running :app:assembleDebug
|_ this.implementation(androidx.lifecycle:lifecycle-livedata-ktx:2.2.0)
running :app:assembleDebug
|_ commonDependencies.testImplementation.each({ -> ... })
running :app:assembleDebug
Processing /Users/USER/_JOZ/Development/apps/github/sports/kick_analyzer/build.gradle ...
Processing /Users/USER/_JOZ/Development/apps/github/sports/kick_analyzer/settings.gradle ...
Processing /Users/USER/_JOZ/Development/apps/github/sports/kick_analyzer/code_coverage.gradle ...
NO UNUSED DEPENDENCIES FOUND FOR GRADLE TASK :app:assembleDebug:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.