usnistgov / jsip

JSIP: Java SIP specification Reference Implementation (moved from java.net)
Other
285 stars 129 forks source link

Question about evolving build to a more recent Java version and full maven structure #72

Open JordanTerri opened 2 years ago

JordanTerri commented 2 years ago

Is there a team or someone working on:

I've been following this repo for years now, and I worked with JSIP during 7 years (and by the way I must thank you guys for all the great work you're doing), and still I can't get it: why not moving to maven and why still using java 1.5 as a target (cf. https://github.com/usnistgov/jsip/blob/master/ant-build-config.properties) ??

I'm probably kicking a open door, so I apologize in advance, again: I sincerly think you're doing a great job with this lib.

JordanTerri commented 2 years ago

For what it's worth, I've forked the repo, to try to rearrange src folders with a proper maven structure, and so separating code in as man modules as necessary, following what's hasbeen started in folder "m2" with pom.xml files.

If interested: https://github.com/JordanTerri/jsip/tree/feature/full-maven-build .

vladimirralev commented 2 years ago

Yep that's a tough decision. Refactoring like this wipes out all commit history which is very valuable for tracking things down as well as contributor recognition. There are some upcoming git features that would make this possible, but not right now.

JordanTerri commented 2 years ago

I was worried about the history too, but as far as I can see it looks good to me.

image

If you have time, please check my "in progress" work https://github.com/JordanTerri/jsip/tree/feature/full-maven-build

vladimirralev commented 2 years ago

I am not sure what you are looking at, I think git has some hash matching features but it's not going to keep the metadata. Look at the github presentation https://github.com/usnistgov/jsip/blob/master/src/gov/nist/javax/sip/SipStackImpl.java vs https://github.com/JordanTerri/jsip/blob/feature/full-maven-build/jsip/jain-sip-ri/src/main/java/gov/nist/javax/sip/SipStackImpl.java, contributors and history are lost.

Screenshot 2021-11-17 at 11 54 21

I know there are upcoming features in git to address this but not quite there yet.

JordanTerri commented 2 years ago

Well this is weird. The screenshot I sent was from VSCode and it's the git history view from a file, so we can see that the history is still there. I opened it in Eclipse to check the git history view, and the result is that we can see the modification history and related contributors: Capture d’écran de 2021-11-17 13-25-39

And strangely when using CLI i got the same result as github...

$ git log SipStackImpl.java
    commit 35067324fbeb7ccdfbad16442daf2421b6196d6f
    Author: JordanTerri <jordan.territorio@gmail.com>
    Date:   Sun Nov 14 20:29:01 2021 +0100

    First version of a full mavenization
    * creating a jsip folder for parent pom with modules
    * creating clean java project structure with maven
    * moving source code to new structure
    * moving unit tests to new structure
    * compilation and build ok
    * fix few unit tests that crashes

-_- I may have to check on my git skills....

JordanTerri commented 2 years ago

Ok got my answer. The history is still there. Using command line if you make git log --follow src/main/java/gov/nist/javax/sip/SipStackImpl.java you have the full history of modifications.

$ git log --follow src/main/java/gov/nist/javax/sip/SipStackImpl.java
commit 35067324fbeb7ccdfbad16442daf2421b6196d6f
Author: JordanTerri <jordan.territorio@gmail.com>
Date:   Sun Nov 14 20:29:01 2021 +0100

    First version of a full mavenization
    * creating a jsip folder for parent pom with modules
    * creating clean java project structure with maven
    * moving source code to new structure
    * moving unit tests to new structure
    * compilation and build ok
    * fix few unit tests that crashes

commit cf2e29f27e4a5ef2303a3a41aa88616c0525a534
Author: Nathan Miles <nathan.miles95@gmail.com>
Date:   Fri Nov 2 16:49:11 2018 -0400

    Add support for TCP_NODELAY

commit e014e37ee69e30e9dc9ddfa4d51b041571c020a2
Author: fre42 <fre@cycos.com>
Date:   Tue Feb 20 16:14:39 2018 +0100

    fixed createListeningPoint in case of IOException

commit 21ab27a4b096320f875bf604cff77fd8f95e2c4f
Author: Simon Lavigne-Giroux <simon.lavigne-giroux@bell.ca>
Date:   Thu Jul 20 17:16:08 2017 -0400

    Adding new config gov.nist.javax.sip.SERVER_LOOP_DETECTION which allows the disabling of server loop detection

...

I checked on github opened bugs, and basically this is a discussion that is ongoing for a long time now. So basically it's more like github has a bug, than git doesn't support the feature. The feature is up on git side, but not on github :

So in my opinion there's no real stop on moving the structure to a full compliant maven structure. However, I'll try an other approach using git mv (https://git-scm.com/docs/git-mv) in place of simply moving folders from one point to another and chek if it has better results with how github handles history display.

[EDIT] Same result using git mv. You have access to full history when using --follow option on git log command. This behaviour is not used by default on Github.

JordanTerri commented 2 years ago

Hi folks, Still working on a maven structure on my spare time, and I wanted to share the status with you. At this point I think I think I have finished extracting each projects as maven projects (I had to give some a name so I basically choose one corresponding to folders when required). Everything is compiling, so I'll give a run on every tests procedure when I got some time. If anyone wants to take a look, I'm open to suggestion. I'll probably rename few folders in the end (like the jsip subfolder containing projects which will be probably be named projects) and remove m2 folder or some others that won't be necessary in the end.

JordanTerri commented 2 years ago

Hi guys,

I wanted to inform you that I've finished to make a maven compliant structure that builds and run tck tests. I'll probably submit a pull-request in the next days, but if someone's interested, one can find the current work here : https://github.com/JordanTerri/jsip/tree/feature/full-maven-build .

And for the record, after the submitting the PR, I may start working on making the code Java 11 compliant, and let Java 1.5, 1.6 and 1.7 behind.