pki-bot / pki-issues-final

0 stars 0 forks source link

Using separate javac output folder for each package #888

Open pki-bot opened 4 years ago

pki-bot commented 4 years ago

This issue was migrated from Pagure Issue #894. Originally filed by edewata (@edewata) on 2014-03-06 03:06:39:


Currently all Java codes from different packages are compiled into the same output folder:

javac(<jar package>
    SOURCES
        <java package 1>/*.java
        <java package 2>/*.java
    OUTPUT_DIR
        ${CMAKE_BINARY_DIR}/classes
)

Then they are packaged into a jar file by explicitly listing the files for that package.

jar(<jar package>
    INPUT_DIR
        ${CMAKE_BINARY_DIR}/classes
    FILES
        <java package 1>/*.class
        <java package 2>/*.class
)

If the list of files is wrong, the files could be packaged into a wrong jar file, and it can be difficult to troubleshoot (e.g. class loading issue).

Ideally they should be compiled into separate folders and the list of files should be simplified to include all files:

javac(<jar package>
    SOURCES
        *.java

    OUTPUT_DIR
        ${CMAKE_BINARY_DIR}/<jar package>
)

jar(<jar package>
    INPUT_DIR
        ${CMAKE_BINARY_DIR}/<jar package>
    FILES
        *.class
)
pki-bot commented 4 years ago

Comment from edewata (@edewata) at 2016-12-06 04:01:09

The build folder separation has been done in ticket 2505. The remaining work is to remove the explicit list of classes to include in the JAR file.

pki-bot commented 4 years ago

Comment from edewata (@edewata) at 2017-02-27 13:58:35

Metadata Update from @edewata: