Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-4586

Fix reflect-config.json generation

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Blocker Blocker
    • None
    • None
    • None
    • None
    • False
    • False
    • Undefined
    • Hide

      Make a NativeImage test (e.g. inside kogito-examples/pmml-quarkus-example)

      Show
      Make a NativeImage test (e.g. inside kogito-examples/pmml-quarkus-example)
    • ---
    • ---
    • 2021 Week 07-09 (from Feb 15), 2021 Week 10-12 (from Mar 8)

      Native image compilation requires a "reflect-config.json" file for each package containing the full canonical name of of "declared types".

      Possible solution
      1) inside PMMLCogitoCodegen: iterate over all the sources in rulesSourceMap and look for a "org.drools.core.factmodel.GeneratedFact" (it mark the declared types)
      2) collect the full name of such sources (should be the key in the rulesSourceMap)
      3) Modify KogitoPakageSources to expose `new GeneratedFile("META-INF/native-image/" + pkgModel.getPathName() + "/reflect-config.json", reflectConfigSource(pojoClasses));` as static method
      4) invoke that method to create the reflect-config.json files
      5) add this files as resources to the generetad file list

            gcardosi Gabriele Cardosi (Inactive)
            gcardosi Gabriele Cardosi (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: