tornadofx2 icon indicating copy to clipboard operation
tornadofx2 copied to clipboard

Split code into core and submodules for non-core code

Open ctadlock opened this issue 4 years ago • 9 comments

Going to move the following out of core:

  • json
  • rest/http

The resulting folder structure will be:

  • / (README.md, CHANGELOG.md, LICENSE)
  • src/ (parent folder for all source)
  • src/tornadofx2 (tornadofx2 core; root for pom.xml)
  • src/tornadofx2/src (tornadofx2 core; code)
  • src/tornadofx2-json (json extensions; root for pom.xml)
  • src/tornadofx2-json/src (json extensions; code)
  • src/tornadofx2-rest (rest extensions; root for pom.xml)
  • src/tornadofx2-rest/src (rest extensions; code)
  • docs/ root for documentation

ctadlock avatar May 18 '20 07:05 ctadlock

If I can add my $0.02, I'm not a fan of the /src/ directory. I prefer either having the different modules at root (very common, e.g. Spring)

  • /tornadofx2-core/ (or tornadofx2-base, I'm not a fan of just tornadofx2)
  • /tornadofx2-rest/
  • /tornadofx2-.../
  • /docs/
  • etc.

Or, if a directory is desired, use /modules/ (less common, but not rare, e.g. JavaFX).

  • /modules/tornadofx2-core/
  • /modules/tornadofx2-rest/
  • /modules/tornadofx2-.../
  • /docs/
  • etc.

I think the /src/[module]/src/ construct is quite strange.

ruckustboom avatar May 18 '20 13:05 ruckustboom

Those two options were my preference as well. @ctadlock - if we put all modules on /, we still get all the modules as siblings, and we can still have a docs folder on the same level. Do you have a problem with that/do you see any issues with it?

edvin avatar May 18 '20 14:05 edvin

Ya, no plan survives first contact with battle.... I spent a while playing with Maven's multi-module projects and it requires a different structure than what I had proposed. You cant have the parent module be named the same as a submodule; so the parent can be named tornadofx2 and the submodule for "core" also named tornadofx2.

I'm fine not having a src folder at root. It works well for my company but not going to die on that hill here. Doesn't cause an issue with docs.

I renamed rest to web to make it a bit more generic for any rest/http/web related code.

I tested it with IntelliJ and it opens up great just using the "open project" function. Here is what I came up with as a skeleton:

I created a skeleton project, you can download it on Dropbox. Didn't want to clutter GitHub. https://www.dropbox.com/s/y1bbf9bdqnhiit2/tornadofx2.zip?dl=0

IntelliJ

image

File system

image

Parent pom.xml

image

ctadlock avatar May 19 '20 05:05 ctadlock

@edvin Another question for you.. we named this GitHub repository tornadofx2 because it needed a different name than the tornadofx one. Ok. However that doesn't mean we need to name the modules and artifacts within this repository tornadofx2. Our change to start off here with version 2.1 resolves the conflict.

So do you want the modules here to be named tornadofx or tornadofx2?

ctadlock avatar May 19 '20 05:05 ctadlock

This looks good! The modules can be named only tornadofx- IMO. Also, while we're knit picking - to me, web sounds like a folder for the project webpage. Perhaps http is a less ambiguous name for that module?

edvin avatar May 19 '20 06:05 edvin

This looks good! The modules can be named only tornadofx- IMO. Also, while we're knit picking - to me, web sounds like a folder for the project webpage. Perhaps http is a less ambiguous name for that module?

Now is the time to nitpick. http is fine.

ctadlock avatar May 19 '20 06:05 ctadlock

Hello, status project ?

SchweinchenFuntik avatar Nov 09 '20 17:11 SchweinchenFuntik

After switching to gradle this cant be merged without a rework. @ctadlock what is your schedule/planning?

JacekWicka avatar Apr 01 '21 11:04 JacekWicka

how do you look at adding kotlin and kotlin DSL contacts to avoid problems with scopes.

I can do this.

Is it better to do this in the new Github Projects?

SchweinchenFuntik avatar Apr 01 '21 16:04 SchweinchenFuntik