Skip to content

build: update to Gradle 7.6.4 (prev. 5.6.4)#313

Merged
justparking merged 27 commits into
museumsvictoria:devfrom
scroix:upgrade/gradle-7.6
Apr 30, 2024
Merged

build: update to Gradle 7.6.4 (prev. 5.6.4)#313
justparking merged 27 commits into
museumsvictoria:devfrom
scroix:upgrade/gradle-7.6

Conversation

@scroix
Copy link
Copy Markdown
Member

@scroix scroix commented Mar 30, 2024

Just an exercise in maintenance, but also managed to roll up some convenient updates as well.

  • Upgrade to Gradle 7.6.4 (bin) from 5.6.4 (all)
  • Resolve subsequent depreciations
  • Extract git/build variables to parent build.gradle for re-use
  • Introduce FileChecker class/method(s) to nodel-webui-js such that subsequent builds are only triggered when any of the following folders or files have been altered:
src/ 
package.json
package-lock.json
Gruntfile.js

@scroix scroix added the build Anything related to the building of the software label Mar 30, 2024
@scroix scroix requested a review from justparking March 30, 2024 02:49
@scroix
Copy link
Copy Markdown
Member Author

scroix commented Mar 30, 2024

If this is judged to be a useful PR; let's squash it. It took a whole lot of spaghetti to get to something I'm proud of.

@justparking
Copy link
Copy Markdown
Collaborator

justparking commented Apr 2, 2024

Hey @scroix - that's a lot of work you did there! Fantastic.

Now that I know you can get your hands dirty with Gradle, I've got a few other thoughts about how nodel is built which I'll raise in separate issues.

For the record, I've done a quick diff (patch format) of the build output differences from the following commands:

The commands were:

  • gradlew --stop
  • git clean -xfd
  • gradlew build
  • gradlew --version

"old" gradle, 5.6.4 is in red. 7.6.4 is in green. Everything else is common output.

diff --git a/log.txt b/log.txt
index 8434287..0bbd7f3 100644
--- a/log.txt
+++ b/log.txt
@@ -1,4 +1,4 @@
-H:\nodel>gradlew --stop
+H:\scroix-nodel>gradlew --stop
 Stopping Daemon(s)
 1 Daemon stopped
 
@@ -11,7 +11,7 @@ Stopping Daemon(s)
 
 
 
-H:\nodel>git clean -xfd
+H:\scroix-nodel>git clean -xfd
 Removing .gradle/
 Removing nodel-framework/build/
 Removing nodel-jyhost/build/
@@ -19,7 +19,6 @@ Removing nodel-webui-js/build/
 Removing nodel-webui-js/node_modules/
 Removing nodel-webui-js/src/dark/theme.less
 Removing nodel-webui-js/src/light/theme.less
-Removing nodel-webui-js/temp/
 
 
 
@@ -30,26 +29,39 @@ Removing nodel-webui-js/temp/
 
 
 
-H:\nodel>gradlew build
-Starting a Gradle Daemon, 2 stopped Daemons could not be reused, use --status for details
+
+H:\scroix-nodel>gradlew build
+Starting a Gradle Daemon, 3 stopped Daemons could not be reused, use --status for details
+Couldn't get final path for handle 0x14e8, error code: 0
 
 > Task :nodel-framework:compileJava
+Caught exception: Couldn't resolve final path of, error = 0: H:\scroix-nodel
 Note: Some input files use or override a deprecated API.
 Note: Recompile with -Xlint:deprecation for details.
 
 > Task :nodel-webui-js:npmInstall
 
-> core-js-pure@3.19.1 postinstall H:\nodel\nodel-webui-js\node_modules\core-js-pure
+> core-js-pure@3.19.1 postinstall H:\scroix-nodel\nodel-webui-js\node_modules\core-js-pure
 > node -e "try{require('./postinstall')}catch(e){}"
 
+Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
+
+The project needs your help! Please consider supporting of core-js:
+> https://opencollective.com/core-js
+> https://patreon.com/zloirock
+> https://paypal.me/zloirock
+> bitcoin: bc1qlea7544qtsmj2rayg0lthvza9fau63ux0fstcz
+
+Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
 
-> @fortawesome/fontawesome-free@5.15.4 postinstall H:\nodel\nodel-webui-js\node_modules\@fortawesome\fontawesome-free
+
+> @fortawesome/fontawesome-free@5.15.4 postinstall H:\scroix-nodel\nodel-webui-js\node_modules\@fortawesome\fontawesome-free
 > node attribution.js
 
 Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com
 License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
 
-added 260 packages from 1212 contributors and audited 265 packages in 1.753s
+added 260 packages from 1212 contributors and audited 265 packages in 1.783s
 
 16 packages are looking for funding
   run `npm fund` for details
@@ -58,13 +70,6 @@ found 22 vulnerabilities (10 moderate, 11 high, 1 critical)
   run `npm audit fix` to fix them, or `npm audit` for details
 
 > Task :nodel-webui-js:gruntRun
-
-> bootskel@0.0.1 run-grunt H:\nodel\nodel-webui-js
-> grunt
-
-Running "googlefonts:build" (googlefonts) task
->> 2 fonts downloaded.
-
 Running "copy:updatetheme" (copy) task
 Copied 2 files
 
@@ -100,8 +105,14 @@ Done.
 Note: Some input files use or override a deprecated API.
 Note: Recompile with -Xlint:deprecation for details.
 
-BUILD SUCCESSFUL in 34s
-19 actionable tasks: 19 executed
+Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
+
+You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
+
+See https://docs.gradle.org/7.6.4/userguide/command_line_interface.html#sec:command_line_warnings
+
+BUILD SUCCESSFUL in 43s
+20 actionable tasks: 19 executed, 1 up-to-date
 
 
 
@@ -113,14 +124,14 @@ BUILD SUCCESSFUL in 34s
 
 
 
-H:\nodel>dir nodel-jyhost\build\distributions\standalone\nodelhost-dev-2.2.1-rev507.jar
+H:\scroix-nodel>dir nodel-jyhost\build\distributions\standalone\nodelhost-upgrade\gradle-7.6-2.2.1-rev529.jar
  Volume in drive H is RamDisk
  Volume Serial Number is C4F1-9937
 
- Directory of H:\nodel\nodel-jyhost\build\distributions\standalone
+ Directory of H:\scroix-nodel\nodel-jyhost\build\distributions\standalone\nodelhost-upgrade
 
-03/04/2024  09:33 AM        19,599,932 nodelhost-dev-2.2.1-rev507.jar
-               1 File(s)     19,599,932 bytes
+03/04/2024  09:31 AM        19,014,704 gradle-7.6-2.2.1-rev529.jar
+               1 File(s)     19,014,704 bytes
                0 Dir(s)   3,479,515,136 bytes free
 
 
@@ -133,19 +144,19 @@ H:\nodel>dir nodel-jyhost\build\distributions\standalone\nodelhost-dev-2.2.1-rev
 
 
 
-H:\nodel>gradlew --version
+H:\scroix-nodel>gradlew --version
 
 ------------------------------------------------------------
-Gradle 5.6.4
+Gradle 7.6.4
 ------------------------------------------------------------
 
-Build time:   2019-11-01 20:42:00 UTC
-Revision:     dd870424f9bd8e195d614dc14bb140f43c22da98
+Build time:   2024-02-05 14:29:18 UTC
+Revision:     e0bb3fc8cefad8432c9033cdfb12dc14facc9dd9
 
-Kotlin:       1.3.41
-Groovy:       2.5.4
-Ant:          Apache Ant(TM) version 1.9.14 compiled on March 12 2019
+Kotlin:       1.7.10
+Groovy:       3.0.13
+Ant:          Apache Ant(TM) version 1.10.13 compiled on January 4 2023
 JVM:          1.8.0_382 (Amazon.com Inc. 25.382-b05)
 OS:           Windows 11 10.0 amd64
 
-H:\nodel>
\ No newline at end of file
+H:\scroix-nodel>
\ No newline at end of file

One thing I notice is that the googlefonts task no longer runs? I haven't actually done a comparison of the output yet to be sure.

I'll start using the build and see what issues I come across.

- 'default' includes googlefonts build, but the 'build' command does not
@scroix
Copy link
Copy Markdown
Member Author

scroix commented Apr 3, 2024

That's great to hear I'm on the right track 🙌

It looks like the problem was that I was targeting a very particular build job in the Gruntfile which ignored Google Fonts. Thank you for catching it.

@scroix scroix marked this pull request as draft April 4, 2024 00:23
- This tackles a tiny regression which saw us lose -dev- handled in the generated .jar filename
- We also handle the odd case of building in a git branch which includes a forward slash
@scroix scroix marked this pull request as ready for review April 4, 2024 03:52
@scroix
Copy link
Copy Markdown
Member Author

scroix commented Apr 4, 2024

I noticed a tiny regression where the built .jar wasn't including the branch name which I've also just resolved.

Here's a full output of the diff.

diff --git a/log_old b/log_new
index cd60a48..1a7aa58 100644
--- a/log_old
+++ b/log_new
@@ -22,31 +22,23 @@ Starting a Gradle Daemon, 2 stopped Daemons could not be reused, use --status fo
 > Task :nodel-framework:test NO-SOURCE
 > Task :nodel-framework:check UP-TO-DATE
 > Task :nodel-framework:build
+> Task :nodel-webui-js:clean UP-TO-DATE
 > Task :nodel-webui-js:nodeSetup
 > Task :nodel-webui-js:npmSetup SKIPPED
 
 > Task :nodel-webui-js:npmInstall
 
-> core-js-pure@3.19.1 postinstall C:\Users\scroix\sandbox\nodel\nodel\nodel-webui-js\node_modules\core-js-pure
+> core-js-pure@3.19.1 postinstall C:\Users\scroix\sandbox\nodel\scroix-nodel\nodel-webui-js\node_modules\core-js-pure
 > node -e "try{require('./postinstall')}catch(e){}"

-> @fortawesome/fontawesome-free@5.15.4 postinstall C:\Users\scroix\sandbox\nodel\nodel\nodel-webui-js\node_modules\@fortawesome\fontawesome-free
+> @fortawesome/fontawesome-free@5.15.4 postinstall C:\Users\scroix\sandbox\nodel\scroix-nodel\nodel-webui-js\node_modules\@fortawesome\fontawesome-free
 > node attribution.js
 
 Font Awesome Free 5.15.4 by @fontawesome - https://fontawesome.com
 License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
 
-added 260 packages from 1212 contributors and audited 265 packages in 15.742s
+added 260 packages from 1212 contributors and audited 265 packages in 5.094s
 
 16 packages are looking for funding
   run `npm fund` for details
@@ -55,10 +47,6 @@ found 22 vulnerabilities (10 moderate, 11 high, 1 critical)
   run `npm audit fix` to fix them, or `npm audit` for details
 
 > Task :nodel-webui-js:gruntRun
-
-> bootskel@0.0.1 run-grunt C:\Users\scroix\sandbox\nodel\nodel\nodel-webui-js
-> grunt
-
 Running "googlefonts:build" (googlefonts) task
 >> 2 fonts downloaded.
 
@@ -126,19 +114,25 @@ Done.
 > Task :nodel-webui-js:check UP-TO-DATE
 > Task :nodel-webui-js:build
 
-BUILD SUCCESSFUL in 1m 43s
-19 actionable tasks: 19 executed
+Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
+
+You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
+
+See https://docs.gradle.org/7.6.4/userguide/command_line_interface.html#sec:command_line_warnings
+
+BUILD SUCCESSFUL in 1m 23s
+20 actionable tasks: 19 executed, 1 up-to-date
 
 ------------------------------------------------------------
-Gradle 5.6.4
+Gradle 7.6.4
 ------------------------------------------------------------
 
-Build time:   2019-11-01 20:42:00 UTC
-Revision:     dd870424f9bd8e195d614dc14bb140f43c22da98
+Build time:   2024-02-05 14:29:18 UTC
+Revision:     e0bb3fc8cefad8432c9033cdfb12dc14facc9dd9
 
-Kotlin:       1.3.41
-Groovy:       2.5.4
-Ant:          Apache Ant(TM) version 1.9.14 compiled on March 12 2019
+Kotlin:       1.7.10
+Groovy:       3.0.13
+Ant:          Apache Ant(TM) version 1.10.13 compiled on January 4 2023
 JVM:          11.0.19 (Eclipse Adoptium 11.0.19+7)
 OS:           Windows 11 10.0 amd64
 

@scroix scroix self-assigned this Apr 6, 2024
@scroix scroix added the dependencies Pull requests that update a dependency file label Apr 6, 2024
@scroix scroix changed the base branch from master to dev April 25, 2024 01:08
@justparking justparking merged commit c5d34e5 into museumsvictoria:dev Apr 30, 2024
@scroix scroix deleted the upgrade/gradle-7.6 branch May 3, 2024 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build Anything related to the building of the software dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants