kevcodez / gradle-upgrade-interactive

CLI to interactively upgrade gradle dependencies, inspired by yarn.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

in multi-project case the version in the sub-project's build.gradle files do not replaced

lfarkas opened this issue · comments

even if i select all dependencies to update, only the toplevel build.gradle was edited and all others remain the seme (even without an error or warning message).

@lfarkas thanks for the report. Could you create a small reproducible project? It doesn't need any source code, just some directory hierarchy and the gradle files containing the dependency that you want to upgrade . I'd greatly appreciate that.

@lfarkas Thanks. I'll have a look during the weekend

@lfarkas Released version 0.5.0 with multi-project support. Could you give it a spin?

npm install -g gradle-upgrade-interactive

Run gradle-upgrade-interactive in the gradle project root directory

now something strange happened. it can'f find the local gradlew:

# ./gradlew --version

------------------------------------------------------------
Gradle 6.1.1
------------------------------------------------------------

Build time:   2020-01-24 22:30:24 UTC
Revision:     a8c3750babb99d1894378073499d6716a1a1fa5d

Kotlin:       1.3.61
Groovy:       2.5.8
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          1.8.0_242 (Oracle Corporation 25.242-b08)
OS:           Linux 5.4.17-200.fc31.x86_64 amd64

# gradle-upgrade-interactive
Unable to find Gradle Wrapper or Gradle CLI.

@lfarkas Published version 0.5.1. Please install the latest version and try again.

If it does not work, please run gradle-upgrade-interactive -d and post the output.

# gradle-upgrade-interactive -d
Determining gradle command
isWindows: false
Checking if wrapper file gradlew exists
Determined gradle command: null, wrapper: false
Unable to find Gradle Wrapper or Gradle CLI.
# ls -al gradlew
-rwxrwxr-x 1 lfarkas lfarkas 5764 Jan 30 15:07 gradlew*

Released 0.5.2, please upgrade again. I was actually missing an import after the internal refactorings.

Sorry for the hustle.

still the same.

Same output with gradle-upgrade-interactive -d?

gradle-upgrade-interactive --version showing 0.5.2?

ops sorry run in a wrong directory! now just check it's working properly...but seems to very slow...

The initial call to get dependencyUpdates (using the versions plugin) can be rather slow. After the first call, it should be way faster. I will also investigate whether it's an issue in my code. I am pretty much just delegating the call to the gradle plugin and getting the results.

It may also depend on your maven repositories. Run ./gradlew dependencyUpdates to see if it's fast. If ./gradlew dependencyUpdates is fast and gradle-upgrade-interactive is slow, then that's my bad.

I'll have a look.

working:-)
except the for som unknown reasone it's always find me this update:

  •    classpath "com.hello2morrow:sonargraph-gradle-plugin:9.13.0"
    
  •    classpath "com.hello2morrow:sonargraph-gradle-plugin:9.13.8"
    

but it's a bug in the upstream dependencyUpdates.
thanks

Thanks for sticking by @lfarkas !

By the way, you can also configure the versions plugin to reject certain versions. Check https://github.com/ben-manes/gradle-versions-plugin

That way, that specific version wouldn't pop up all the time.

still not working in subprojects...ie. show there are nbewer version i can select the but do not replace the version

@lfarkas Can you please attach the parent build.gradle and the child build.gradle and tell me which version doesn't get replaced?

It's also enough if you only include the affected dependency/variables from the two files in the gradle build files, you can remove the rest.

The CLI is mostly doing string replacements, so there might be some patterns that are not matched yet and simply need to be added.

Released 0.6.0 that has better support for multi-project builds better. Still, without an example it is going to be hard to reproduce, it might just be a missing pattern.

sorry i forget about it. what should i have to show?
this's a multi level gradle build but here are the relevant part as you can see eg in face/app/build.gradle tika-core - 1.23 => 1.24
but it's not working.

Released 0.6.1

Build file search is now recursively. Previously, only build files below the current directory were found.

now i've got and error for a broken link:
gradle-upgrade-interactive
internal/fs/utils.js:230
throw err;
^

Error: ENOENT: no such file or directory, stat './vidux/data/vhv/var/www/html/vhv/data'
at Object.statSync (fs.js:932:3)
at /home/lfarkas/.npm-packages/lib/node_modules/gradle-upgrade-interactive/buildFiles.js:41:14
at Array.forEach ()
at getAllBuildFiles (/home/lfarkas/.npm-packages/lib/node_modules/gradle-upgrade-interactive/buildFiles.js:40:11)
at /home/lfarkas/.npm-packages/lib/node_modules/gradle-upgrade-interactive/buildFiles.js:42:24
at Array.forEach ()
at getAllBuildFiles (/home/lfarkas/.npm-packages/lib/node_modules/gradle-upgrade-interactive/buildFiles.js:40:11)
at /home/lfarkas/.npm-packages/lib/node_modules/gradle-upgrade-interactive/buildFiles.js:42:24
at Array.forEach ()
at getAllBuildFiles (/home/lfarkas/.npm-packages/lib/node_modules/gradle-upgrade-interactive/buildFiles.js:40:11) {
errno: -2,
syscall: 'stat',
code: 'ENOENT',
path: './vidux/data/vhv/var/www/html/vhv/data'

I released 0.6.4 with a few fixes. I was able to test this successfully on a multi-project build on windows.

But seems to very slow...

I was able to pinpoint one issue that hopefully resolves the "hanging" completely.

The build files should also properly resolve on linux now, in case they don't, you can also paste the debug log here using gradle-upgrade-interactive -d after upgrading to 0.6.4.

Thank you for not giving up on me yet and helping me troubleshoot 🙈

same error for broken link

Can you please run it using -d so I can see the debug output?

nothing else:

gradle-upgrade-interactive -d
Determining gradle command
isWindows: false
Checking if wrapper file gradlew exists
Wrapper file exists
Determined gradle command: ./gradlew, wrapper: true
Recursively looking for build files in directory /home/lfarkas/work/vidux/vidux/java
internal/fs/utils.js:230
    throw err;
    ^

Error: ENOENT: no such file or directory, stat '/home/lfarkas/work/vidux/vidux/java/vidux/data/vhv/var/www/html/vhv/data'
    at Object.statSync (fs.js:932:3)
    at /home/lfarkas/.npm-packages/lib/node_modules/gradle-upgrade-interactive/buildFiles.js:42:27
    at Array.forEach (<anonymous>)
    at getAllBuildFiles (/home/lfarkas/.npm-packages/lib/node_modules/gradle-upgrade-interactive/buildFiles.js:41:11)
    at /home/lfarkas/.npm-packages/lib/node_modules/gradle-upgrade-interactive/buildFiles.js:45:28
    at Array.forEach (<anonymous>)
    at getAllBuildFiles (/home/lfarkas/.npm-packages/lib/node_modules/gradle-upgrade-interactive/buildFiles.js:41:11)
    at /home/lfarkas/.npm-packages/lib/node_modules/gradle-upgrade-interactive/buildFiles.js:45:28
    at Array.forEach (<anonymous>)
    at getAllBuildFiles (/home/lfarkas/.npm-packages/lib/node_modules/gradle-upgrade-interactive/buildFiles.js:41:11) {
  errno: -2,
  syscall: 'stat',
  code: 'ENOENT',
  path: '/home/lfarkas/work/vidux/vidux/java/vidux/data/vhv/var/www/html/vhv/data'
}

What linux distribution are you using? I do not know, how those paths are resolved.

I changed the search for build file paths to use resolve rather than join, hoping it helps.

I cannot reproduce this issue on Windows/Mac.

Released 0.6.5, but that's just a blind shot. I'll try a linux docker image similar to your distribution.

fedora-31

I couldn't reproduce on a fedora-32 docker image. What version of NodeJS are you using?

fedora-31's default nodejs-12.16.1-1.fc31.x86_64 and it seems to working now:-)