archiver-appliance / epicsarchiverap

This is an implementation of an archiver for EPICS control systems that aims to archive millions of PVs.
Other
38 stars 37 forks source link

Remove most of the ant build file #176

Closed jacomago closed 5 months ago

jacomago commented 1 year ago

Also

jeonghanlee commented 1 year ago

Is there any specific reason to remove ant from this repository?

@jeonghanlee

jacomago commented 1 year ago

Is there any specific reason to remove ant from this repository?

@jeonghanlee

Main reasons:

I could add calling gradle from ant if you really want to keep ant.

jeonghanlee commented 1 year ago

@slacmshankar Are we going to the gradle as the archiver appliance building system now? If so, I must wait for these works and study how Gradle works before upgrading my environment.

Please let me know what the schedule or plan will be for the migration from Ant to Gradle.

jacomago commented 1 year ago

@jeonghanlee I altered the pull request a little to make the move easier.

From playing around with github.com:jeonghanlee/epicsarchiverap-env I think you would only have to manually add the maria db connector into the tomcat folder and call gradle instead of ant. I don't think you even need to install ant anymore as gradle includes an ant runner, and can be run from the wrapper.

slacmshankar commented 10 months ago

@jeonghanlee Why don't you help make a call on this? If the suggestion works for you, we'll move to gradle and that helps with VSCode and the like.

jeonghanlee commented 10 months ago

@slacmshankar it is up to you if you want to move the gradle. I don't care about Java building environments, which typically make me sick. ;) You can decide, so I will accept this change to update my environment.

What I need is well-written documentation on how I can compile them with Gladle.

jeonghanlee commented 3 months ago

@slacmshankar @jacomago I finally evaluated the gradle building system. Then, I realized this is not the Java building system, but the universal building system.

I don't see any advantage in the long term. Anyway, after an hour's study, I saw a new building system, and I could build the archiver appliance without any issues. However, it looks like gradle build doesn't work. Can you make that work? I don't see any advantage to using a heavy wrapper shell script to build Java applications. It also downloads their own gradle file and does something that I don't understand on my Linux system.

I naively thought gradle was a better solution, but it looks like it will be very messy if one cannot maintain it every single day.

Here are questions in my mind

jeonghanlee commented 3 months ago

@slacmshankar @jacomago

If I add some my own files into the source directory, the following command triggers to do something, which I don't ask to do

epicsarchiverap-src ((758004c...))$ ./gradlew build

> Configure project :
[ant:echo] Building the archiver appliance for the site tests
Path for java installation '/usr/lib/jvm/openjdk-17' (Common Linux Locations) does not contain a java executable

> Task :compileTestJava
Note: /home/jeonglee/gitsrc/epicsarchiverap-env/epicsarchiverap-src/src/test/org/epics/archiverappliance/mgmt/pva/actions/NTUtilTest.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /home/jeonglee/gitsrc/epicsarchiverap-env/epicsarchiverap-src/src/test/edu/stanford/slac/archiverappliance/PB/data/BoundaryConditionsSimulationValueGenerator.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :spotlessStyling FAILED
Step 'prettier-format' found problem in 'src/sitespecific/als/template_changes.html':
Can't automatically determine npm executable and none was specifically supplied!

Spotless tries to find your npm executable automatically. It looks for npm in the following places:
- An executable referenced by the java system property 'npm.exec' - if such a system property exists.
- The environment variable 'NVM_BIN' - if such an environment variable exists.
- The environment variable 'NVM_SYMLINK' - if such an environment variable exists.
- The environment variable 'NODE_PATH' - if such an environment variable exists.
- In your 'PATH' environment variable

If autodiscovery fails for your system, try to set one of the environment variables correctly or
try setting the system property 'npm.exec' in the build process to override autodiscovery.
java.lang.IllegalStateException: Can't automatically determine npm executable and none was specifically supplied!

...............

 at org.gradle.internal.operations.CurrentBuildOperationRef.with(CurrentBuildOperationRef.java:80)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:314)
        at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:303)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463)
        at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380)
        at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
        at org.gradle.internal.concurrent.AbstractManagedExecutor$1.run(AbstractManagedExecutor.java:47)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':spotlessStyling'.
> Issue processing file: /home/jeonglee/gitsrc/epicsarchiverap-env/epicsarchiverap-src/src/sitespecific/als/template_changes.html

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.5/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD FAILED in 16s
22 actionable tasks: 11 executed, 11 up-to-date

Okay, the building system checked the style, it is good, but what for here?

I see the issue here.

  1. It hides so many detailed steps from end-users if the end users do have not enough knowledge of the Gradle environment which the maintainer defines according to their performance. I see this as a very critical issue since I want to control every step that I execute clearly. I don't want to see these random and unexpected activities when I am going to build the Java application. It looks just fancy and looks nice, and convenient.
  2. There are unnecessary environment variables that should be defined and the end-users should understand every single line and dependency if they encounter any issues
  3. I don't need npm, so why do I have to install and configure to build the Java application here?

If you decide to go the Gradle completely, I have to think, about resuming the ant or maven building system again into the forked repository.

jeonghanlee commented 3 months ago

I am frustating a lot today about gradle, it may be wrong about everything what I see today. And my comments are completely junk. It is the main reason why I cannot find a documentation which I asked and you mentioned here. Where is the documentation about the building system?