scana / ok-gradle Goto Github PK
View Code? Open in Web Editor NEWIntelliJ/Android Studio plugin for searching artifacts ids of popular Java libraries.
License: Apache License 2.0
IntelliJ/Android Studio plugin for searching artifacts ids of popular Java libraries.
License: Apache License 2.0
This isn't a big issue, but I'm curious why the plugin depends on Android support being enabled in IntelliJ - seems like it should work with any Gradle project, android or not.
Should be great if the plugin adds support to the incoming dependency management.
https://docs.gradle.org/nightly/userguide/platforms.html#sub:central-declaration-of-dependencies
The behavior I think that should be ideal:
it adds the version and the top of the file under [versions]
it adds the dependency without assigning it a name or adding the artifact id as name
artifactId = { group = "...", name = "...", version.ref = "..." }
with gradle 3.0.0 using compile is deprecated, it has changed to 'implementation'
The plugin does work while searching for dependency.
But adding a selected dependency to build.gradle.kts does not work.
"Add Dependency" shows a "select module" dialog box but it is disabled and we cannot select anything from it.
"Copy dependency" copies the groovy syntax to the clipboard in stead of the expected Kotllin syntax.
Some libraries requires annotationProcessor statements beside compile statements.
For example:
dependencies {
compile 'com.google.dagger:dagger:2.x'
annotationProcessor 'com.google.dagger:dagger-compiler:2.x'
}
Android studio clicking adding dependency btn give me an empty select a module list can it add it to Gradle?
It would be nice if the dependency was automatically added to the the build.gradle file after searching for it. This could bring some complications for mutli-module projects but should work fine for projects without modules.
hello
thanks for the awesome library!
I have a question - does this library helps with suggesting which dependency comes from, I mean sometimes I also need to add to root build.gradle something like this:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
is there a plan for supporting it?
In newer gradle version you should use implementation
or api
methods instead of compile
Research about searching through internal nexus repositories added by a user (or fetched from repos declared in build.gradle files)
I have cloned this project and run it.
And in Android studio, I can not show the module names.
Hello
Great plugin, but can you add ability to find many dependencies at one time?
It might be helpful, when creating new project
I've used gradle-versions-plugin for this, but something similar with IDE support could also modify build.gradle
to apply the updated versions.
Often I use "Ok, Gradle" inside of a build.gradle file, when I'm already at the position to insert the dependency. Would be nice to have a button to do this, instead of copying the dependency and then have to paste it.
Maybe reuse the "OK" button therefore. IMHO this button is not intuitve, since it just closes the dialog. That's not what I expect. Even more when the tool is called "Ok, Gradle", then I would expect the magic happens on "OK".
This proposal is probably an rival to #4
Hello @scana !
I want to try your plugin next week, it seems super useful.
One thing is that half of my Gradle is in Groovy (build.gradle
) while the other half is in Kotlin (build.gradle.kts
).
As you can see here, it's almost the same except for the parenthesis and double quotes (like in java) instead of single quotes)
-implementation 'com.square.retrofit:retrofit2:2.3.0'
+implementation("com.square.retrofit:retrofit2:2.3.0")
Actually the latter syntax is totally valid in a build.gradle
too!
I could try to submit a pull request if you are interested
I want to use AndroidX ,but the result of searched is null
common thing is that libraries like butter knife and dagger need annotation processor so it would be nice to have that also written there
It seems that modules using pure java gradle plugin do not handle "implementation" keyword for dependencies.
The plugin should be able to detect whether implementation
plugin is supported and use it or fallback to compile
keyword
IDE: Android Studio 3.6 RC 1
OS: Windows 10 1909
OK, Gradle!
version: 0.3.0
Ctrl + Shift + A
shortcut, launch OK, Gradle!
action.OK, Gradle!
window doesn't open. In IDE Fatal Errors window, see the following stack trace:kotlin.TypeCastException: null cannot be cast to non-null type com.intellij.openapi.project.Project
at me.scana.okgradle.OkGradleAction.actionPerformed(OkGradleAction.kt:29)
at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:265)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:282)
at com.intellij.ide.actions.GotoActionAction.lambda$performAction$7(GotoActionAction.java:335)
at com.intellij.openapi.application.TransactionGuardImpl.runSyncTransaction(TransactionGuardImpl.java:82)
at com.intellij.openapi.application.TransactionGuardImpl.lambda$submitTransaction$1(TransactionGuardImpl.java:106)
at com.intellij.openapi.application.TransactionGuardImpl.submitTransaction(TransactionGuardImpl.java:115)
at com.intellij.openapi.application.TransactionGuardImpl.lambda$submitTransactionLater$4(TransactionGuardImpl.java:268)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.doRun(LaterInvocator.java:433)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:416)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:399)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
at java.awt.EventQueue.access$500(EventQueue.java:98)
at java.awt.EventQueue$3.run(EventQueue.java:715)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:878)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:827)
at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:466)
at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:704)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:465)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
OK, Gradle!
window gets opened and it's possible to search for dependencies.
P.S. It looks like the plugin requires a project to be open. In that case, it works as usual.
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.