vigna / fastutil

fastutil extends the Java™ Collections Framework by providing type-specific maps, sets, lists and queues.
Apache License 2.0
1.78k stars 196 forks source link

Core Types only compilation #216

Closed incaseoftrouble closed 3 years ago

incaseoftrouble commented 3 years ago

See #200

vigna commented 3 years ago

That seems to be fine. I'm just thinking whether we are doing this right. In the sense that if the purpose is to have a split distribution, more a conditional compilation we need build.xml to generate three different jars.

incaseoftrouble commented 3 years ago

I have no idea about ant / maven though, I'm gradle-only :-D

Indeed, right now it would be three steps (something like ONLY_BASIC_TYPES=1 make clean sources jar, copy the jar, IO_TYPES=1 make clean sources jar, copy the jar, ...). However I am not sure how easy it is to define that in the build.xml. One could generate the files to different folders (src/core/, src/io, src/full or something like that). This would make building and IDE integration easy but may require some fiddling in the makefile (which I probably know too little about)

vigna commented 3 years ago

So, I tried this and I get 1902 classes with make -s clean sources MINIMAL_TYPES=1. I don' think that was your intention, was it?

incaseoftrouble commented 3 years ago

Huh.

make clean
MINIMAL_TYPES=1 make sources
find src/ -name "*.java" -print | wc -l

outputs 889 for me

EDIT: Ah wait, you are counting .class, I am counting .java files.

EDIT2: I get ~4k classes with minimal types and for 13k "complete" build (counting with find build/ -name "*.class" | wc -l)

vigna commented 3 years ago

Actually, it's that the target clean needs fixing—$(TYPE_ALL) instead of $(TYPE). I was

make -s clean sources MINIMAL_TYPES=1

and that was not cleaning the non-minimal types.

incaseoftrouble commented 3 years ago

Oh oops, I missed that

vigna commented 3 years ago

That has been like that forever, I just discovered the problem :).