question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to add new dependencies?

See original GitHub issue

Context: buildSrcVersions is a Gradle plugin that makes it easier to manage your dependencies inside your IDE. It extracts all your dependencies and search for available dependencies updates.

The description shows how to bootstrap the switch and how to update to new dependencies. However, I can’t see how to add a new dependency. Looks to me that Libs.kt is not meant to be manually edited. So is the idea to add an “old-fashioned” dependency, and then run syncLibs to create a new Libs.kt, and then replace the dependency literal? That feels convoluted. Is there a better way? Perhaps a registerDependency task that takes a dependency string and adds it to Libs.kt and Versions.kt?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jmfayardcommented, Nov 7, 2018

@nkiesel

However, I can’t see how to add a new dependency. Looks to me that Libs.kt is not meant to be manually edited. That feels convoluted. I

That’s correct.

Is there a better way?

I would suggest to use the IDE plugin OK, Gradle! from @scana that solves the adding dependency problem brillantly.

Take a look

Currently, you would still have to run ./gradlew syncTasks and replace the strings with Libs.whateverafter. Ideally, I would like to integrate the IDE plugin with my gradle plugin.

Related: https://github.com/scana/ok-gradle/issues/14

0reactions
jmfayardcommented, Sep 17, 2019

@nkiesel there are finally news on this topic. You can do $ ./gradlew :buildSrcVersions --update or $ ./gradlew refreshVersions --update . It will upgrade to the newer versions and you can fix what you don’t want by looking at the git diff. This will makes it permanent

buildSrcVersions {
    alwaysUpdateVersions()
}

https://github.com/jmfayard/buildSrcVersions/issues/53

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding dependencies to a package.json file - npm Docs
To add dependencies and devDependencies to a package.json file from the command line, you can install them in the root directory of your...
Read more >
Add New Dependencies - WebStorm Guide - JetBrains
To quickly add a new dependency to your project, add an import statement first, then hit Alt+Enter, and click Install and add to ......
Read more >
Add build dependencies - Android Developers
Learn how to add build dependencies using the Gradle build system in Android Studio. ... Creates a new MyArgsProvider object, specifies the input...
Read more >
Installing dependencies | Yarn
yarn install is used to install all dependencies for a project. The dependencies are retrieved from your project's package.json file, and stored in...
Read more >
Add a dependency in Maven - Stack Overflow
Open pom.xml in STS editor, click "Dependencies" tab at bottom 2. Click "Add" in Dependencies group 3. Copy/paste "Maven" tab ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found