telekom / nuSIM-Loader-Application

Reference implementation of the nuSIM loader (nuSIM Loader Application) to request, receive, store and load encrypted nuSIM profiles in accordance with nuSIM specifications.
Apache License 2.0
8 stars 2 forks source link

Make compatible with gradle 7.0 #3

Open Strauteka opened 3 years ago

Strauteka commented 3 years ago

Hello all! My experience setting up project.

If it not possible to make it compatible with gradle 7.0, then point out versions tested, working with. Did not use Gradle before, so obviously I will use latest version from graddle homepage and that is where problem starts. Also maybe migrate gradle.build config to newest configuration keys. https://docs.gradle.org/current/userguide/upgrading_version_5.html Dependencies should no longer be declared using the compile and runtime configurations The usage of the compile and runtime configurations in the Java ecosystem plugins has been discouraged since Gradle 3.4.

Please in Readme point out clean working versions. Is there is some detailed step by step documentations how to set up with quectel BG95? Make it somehow less painfull. If something doing wrong, keep in mind "First use of Gradle..."

Road map

C:\Repositories\nuSIM-Loader-Application\nusimapp>gradle -version

------------------------------------------------------------
Gradle 7.0
------------------------------------------------------------

Build time:   2021-04-09 22:27:31 UTC
Revision:     d5661e3f0e07a8caff705f1badf79fb5df8022c4

Kotlin:       1.4.31
Groovy:       3.0.7
Ant:          Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM:          11.0.8 (Red Hat, Inc. 11.0.8+10-LTS)
OS:           Windows 10 10.0 amd64

C:\Repositories\nuSIM-Loader-Application\gui>yarn version

yarn version v1.22.10
info Current version: 0.0.0
question New version: v1.22.10
info New version: v1.22.10
Done in 25.59s.

C:\Repositories\nuSIM-Loader-Application\gui>yarn install

yarn install v1.22.10
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
info fsevents@1.2.4: The platform "win32" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning "@vue/cli-plugin-babel > babel-loader@8.0.0-beta.3" has unmet peer dependency "webpack@>=2".
warning "@vue/cli-plugin-e2e-cypress > eslint-plugin-cypress@2.0.1" has unmet peer dependency "eslint@>= 3.2.1".
warning "@vue/cli-plugin-eslint > eslint-loader@2.0.0" has unmet peer dependency "webpack@>=2.0.0 <5.0.0".
warning "@vue/eslint-config-prettier > eslint-config-prettier@2.9.0" has unmet peer dependency "eslint@>=3.14.1".
warning "@vue/eslint-config-standard > eslint-config-standard@12.0.0-alpha.0" has unmet peer dependency "eslint@>=5.0.0-alpha.2".
warning "@vue/eslint-config-standard > eslint-plugin-import@2.12.0" has unmet peer dependency "eslint@2.x - 4.x".
warning "@vue/eslint-config-standard > eslint-plugin-node@6.0.1" has unmet peer dependency "eslint@>=3.1.0".
warning "@vue/eslint-config-standard > eslint-plugin-standard@3.1.0" has unmet peer dependency "eslint@>=3.19.0".
warning " > babel-loader@8.0.0-beta.2" has unmet peer dependency "webpack@>=2".
warning "stylelint > postcss-html@0.23.7" has incorrect peer dependency "postcss-syntax@^0.10.0".
warning "stylelint > postcss-markdown@0.23.7" has incorrect peer dependency "postcss-syntax@^0.10.0".
[5/5] Building fresh packages...
Done in 104.29s.

C:\Repositories\nuSIM-Loader-Application\gui>yarn build

yarn run v1.22.10
$ vue-cli-service build

/  Building for production...

 WARNING  Compiled with 2 warnings                                                                                                                                                                                                   08:23:56

 warning

asset size limit: The following asset(s) exceed the recommended size limit (244 KiB).
This can impact web performance.
Assets:
  vendors~app-8dd9f68.css (274 KiB)
  vendors~app-8dd9f68.js (430 KiB)

 warning

entrypoint size limit: The following entrypoint(s) combined asset size exceeds the recommended limit (244 KiB). This can impact web performance.
Entrypoints:
  app (744 KiB)
      vendors~app-8dd9f68.css
      vendors~app-8dd9f68.js
      app-8dd9f68.css
      app-8dd9f68.js

  File                                   Size              Gzipped

  dist\assets\js\components.min.js       78.07 kb          22.69 kb
  dist\vendors~app-8dd9f68.js            430.40 kb         125.20 kb
  dist\assets\js\components.js           196.46 kb         40.68 kb
  dist\assets\js\components.debug.js     64.49 kb          11.66 kb
  dist\app-8dd9f68.js                    37.97 kb          9.25 kb
  dist\2-8dd9f68.js                      11.56 kb          8.33 kb
  dist\3-8dd9f68.js                      10.50 kb          3.41 kb
  dist\4-8dd9f68.js                      2.77 kb           1.11 kb
  dist\1-8dd9f68.js                      1.69 kb           0.85 kb
  dist\0-8dd9f68.js                      0.66 kb           0.44 kb
  dist\vendors~app-8dd9f68.css           273.96 kb         31.93 kb
  dist\assets\css\components.css         131.43 kb         21.67 kb
  dist\assets\css\components.min.css     96.37 kb          18.27 kb
  dist\assets\css\theme-debug.css        41.93 kb          5.00 kb
  dist\assets\css\theme-debug.min.css    36.35 kb          4.91 kb
  dist\assets\css\theme-dark.css         29.84 kb          4.37 kb
  dist\assets\css\theme-dark.min.css     25.23 kb          4.18 kb
  dist\app-8dd9f68.css                   2.04 kb           0.88 kb
  dist\assets\css\theme-bevel.css        0.65 kb           0.33 kb
  dist\assets\css\theme-bevel.min.css    0.58 kb           0.33 kb

  Images and other types of assets omitted.

 DONE  Build complete. The dist directory is ready to be deployed.

Done in 19.29s.

C:\Repositories\nuSIM-Loader-Application\nusimapp>gradle build

...
Task :gui:nodeSetup FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':gui:nodeSetup'.
> Could not resolve all files for configuration ':gui:detachedConfiguration1'.
   > Could not find org.nodejs:node:8.11.2.
     Searched in the following locations:
       - https://nodejs.org/dist/v8.11.2/ivy.xml
     Required by:
         project :gui
...
FIX: 
plugins {
    id("com.github.node-gradle.node") version "2.2.0"
    ...
}

C:\Repositories\nuSIM-Loader-Application\nusimapp>gradle build

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Repositories\nuSIM-Loader-Application\build.gradle' line: 140

* What went wrong:
A problem occurred evaluating root project 'nuSIM-Loader-Application'.
> Could not find method compile() for arguments [com.google.code.findbugs:jsr305:3.0.2] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

FIX
https://docs.gradle.org/current/userguide/upgrading_version_6.html#sec:configuration_removal
#Removal of compile and runtime configurations in gradle.build
compile => implementation 
testCompile => testImplementation
runtime => runtimeOnly
jcenter() => mavenCentral() 
version => project.version
commandLine  '.gradle/yarn/yarn-v1.7.0/bin/yarn', 'build' => commandLine  'cmd', '.gradle/yarn/yarn-v1.7.0/bin/yarn', 'build'
configurations.runtime.resolvedConfiguration... ??? configurations.runtimeSources.resolvedConfiguration... runtime => runtimeSources //does this break something

C:\Repositories\nuSIM-Loader-Application\nusimapp>gradle build --stacktrace --warning-mode all

...
Task :nusimapp:update FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Some problems were found with the configuration of task ':nusimapp:update' (type 'LiquibaseTask').
  - Type 'LiquibaseTask' property 'command' is missing an input or output annotation.

    Reason: A property without annotation isn't considered during up-to-date checking.

    Possible solutions:
      1. Add an input or output annotation.
      2. Mark it as @Internal.
...
FIX Dropping Gradle version
C:\Repositories\nuSIM-Loader-Application\nusimapp>gradle -version

------------------------------------------------------------
Gradle 6.7.1
------------------------------------------------------------

Build time:   2020-11-16 17:09:24 UTC
Revision:     2972ff02f3210d2ceed2f1ea880f026acfbab5c0

Kotlin:       1.3.72
Groovy:       2.5.12
Ant:          Apache Ant(TM) version 1.10.8 compiled on May 10 2020
JVM:          11.0.8 (Red Hat, Inc. 11.0.8+10-LTS)
OS:           Windows 10 10.0 amd64

C:\Repositories\nuSIM-Loader-Application\nusimapp>gradle build

....
BUILD SUCCESSFUL in 26s

C:\Repositories\nuSIM-Loader-Application\nusimapp>gradle run

...
Task :nusimapp:run
Failed to start gui server: java.io.FileNotFoundException: WebDir path .\web does not exist; please set APP_HOME correctly, so that APP_HOME contains a subfolder named 'web'

> Task :nusimapp:run FAILED

FAILURE: Build failed with an exception.

create `../nusimap/web` folder with hand   
copy `../gui/dist/*` content to `../nusimap/web/` with hand   

C:\Repositories\nuSIM-Loader-Application\nusimapp>gradle run

Server started successfully, listening at http://localhost:8088/
<===========--> 90% EXECUTING [2m 3s]
> :nusimapp:run

build.gradle.txt

Strauteka commented 3 years ago

Additional info:

gradle run

Task :nusimapp:run FAILED Failed to start gui server: java.lang.Exception: Error starting managed module 'DAO' Caused by: java.net.ConnectException: Connection refused: connect

Port missmatch in ./build.gradle and default configuration ./nusimapp/src/main/resources/defaultConfig.json

postgresEmbedded {
    port = 54321
}
"database": {
"dialect": "POSTGRES",
"executeLogging": false,
"username": "postgres",
"password": "cG9zdGdyZXM=",
"jdbcURL": "jdbc:postgresql://localhost:5432/postgres?tcpKeepAlive=true"
},

Ater that:

Task :nusimapp:run FAILED Failed to start gui server: java.lang.Exception: Error starting managed module 'DAO' Caused by: org.postgresql.util.PSQLException: FATAL: password authentication failed for user "postgres"

Adding additional info to build.gradle helps:

postgresEmbedded {
    port = 5432
    username = "postgres"
    password = "postgres"
}
docBmuc commented 1 year ago

Doesn't build on Windows10, missing class "ReflectionCache". - For system setup see attached screeenshot. :)

Cheers!

err1