eo icon indicating copy to clipboard operation
eo copied to clipboard

MarkMojo.java:80-83: The mojo doesn't update program...

Open 0pdd opened this issue 1 year ago • 10 comments

The puzzle 1062-6d8a2439 from #1062 has to be resolved:

https://github.com/objectionary/eo/blob/2bb6d7d2680d2e526e80f0d87a79e6a6cdedcd8d/eo-maven-plugin/src/main/java/org/eolang/maven/MarkMojo.java#L80-L83

The puzzle was created by rultor on 15-Sep-22.

Estimate: 30 minutes, role: DEV.

If you have any technical questions, don't ask me, submit new tickets instead. The task will be "done" when the problem is fixed and the text of the puzzle is removed from the source code. Here is more about PDD and about me.

0pdd avatar Sep 15 '22 09:09 0pdd

@yegor256 any objection on the tasks?

mximp avatar Sep 15 '22 12:09 mximp

@mximp no objections, let's do it

yegor256 avatar Sep 15 '22 12:09 yegor256

@OlesiaSub Please assist with this

mximp avatar Sep 15 '22 12:09 mximp

@mximp could you please give me a quick overview of what is going on in foreign catalog? And what exactly "program version" is? I thought is it +version meta, but apparently it is something else. Maybe you can tell me where I can find an example to reproduce this issue?

OlesiaSub avatar Sep 19 '22 10:09 OlesiaSub

@OlesiaSub you can check the logic behind usage of AssembleMojo.ATTR_VERSION. In short: the version attribute is set in several phases: register, discover and mark. Actual value is set in mark phase and is taken from resolved dependencies (06-resolve folder). The issue is that it's set conditionally and the condition is not always correct.

You can think of foreign catalog as a global index of compilation artifacts during EO build.

mximp avatar Sep 19 '22 12:09 mximp

@yegor256 can you please help, it is true that to solve this issue I'll have to add a replace method to Tojo in your lib or maybe there is another solution that I didn't think of?

OlesiaSub avatar Sep 21 '22 13:09 OlesiaSub

@OlesiaSub you can simply use Tojo#set() method. Why not?

yegor256 avatar Sep 21 '22 13:09 yegor256

@yegor256 as you stated: "It's illegal to use #set() to change '%s' attribute" and I need to change the version attribute, so it won't work, right?... or am I missing smth

OlesiaSub avatar Sep 21 '22 13:09 OlesiaSub

@OlesiaSub it's illegal to change id attribute

yegor256 avatar Sep 21 '22 13:09 yegor256

@yegor256 as you stated: "It's illegal to use #set() to change '%s' attribute" and I need to change the version attribute, so it won't work, right?... or am I missing smth

@OlesiaSub Tojo::set() is used exactly for setting foreign attributes. Check MarkMojo class: actual version attribute is set there.

mximp avatar Sep 22 '22 04:09 mximp