I have a legacy project, about 20 years old in total, that I have been tasked with upgrading. It currently uses a combination of Ant and bash scripts to build. I need to turn it into a Gradle project, and get it working, but I am running into several roadblocks.
I found that Gradle likes to have a specific file structure, and the projects file structure does not match. However, I am having trouble figuring out how exactly to organize it in a way that would work well with Gradle. Let me give some brief details of the project.
There are two main subprojects, a Java Servlet Page project, and the Services (Actual backend code) project. The directory structure is something like this
build (Where all the .class files go, where everything is build, etc) lib (Various .jar files needed to compile) tools (Various java tools that are compiled into .jar files and stuck into lib)) packages (Zipped up java projects that are unzipped into the build directory) src /web (Contains all .jsp files) /dist (Contains build scripts) /doc (Contains documentation) /test (Contains several standalone java apps used for testing, and some scripts) /main /services/project-name/(Folders containing actual code) /servlet/project-name/(Folders containing servlet handling code) /test/project-name/(Folders containing unit test code)
The build process involves creating jar files, war files, etc. It’s pretty convoluted and I don’t want to get into it.
I am posting because rearranging all of this is going to be a nightmare, and I don’t want to get it wrong and have to re-do a bunch of work.
Looking through the recommended Gradle setup, it looks like it wants the subprojects as two separate folders at the highest level, which makes sense. But then I have to wonder where I should put the classes, the .war files as they build, the jar files, etc as it builds. How should the unit tests and other tests be organized in it? How do I organize this so the java packages don’t have to be redone (I want to avoid too many code changes)?
There are a lot of moving pieces, it’s overwhelming, and I am new to Gradle. I would love if someone could chime in with some advice.