DaMango
DaMango
Explore posts from servers
JCHJava Community | Help. Code. Learn.
Created by DaMango on 10/27/2024 in #java-help
How to organize build.gradle files and class structure in gradle project?
I want to make a plugin for teamcity and jenkins, but i'm not sure how I should be structuring my project to best fit that. I've seen examples where there are multiple build.gradle files at various levels of the project, but some plugin/dependency definitions seem redundant between them as opposed to being in a more top-level build.gradle (if that makes sense). I'm not familiar with gradle or java at all. Any pointers would be incredibly helpful! I also don't know how classes should be structured in a gradle project. I know there may be differing methodologies here, but I'm thinking the project structure might look like this:
settings.gradle
build.gradle
gradlew
app
- /src
- /main/java/com
- /subproject1_name
- build.gradle
- subproject1.java
- /subproject2_name
- build.gradle
- subproject2.java
- test/java/com
- /subproject1_name
- subproject1.java
- /subproject2_name
- subproject2.java

settings.gradle
build.gradle
gradlew
app
- /src
- /main/java/com
- /subproject1_name
- build.gradle
- subproject1.java
- /subproject2_name
- build.gradle
- subproject2.java
- test/java/com
- /subproject1_name
- subproject1.java
- /subproject2_name
- subproject2.java

Or something like that. Subproject1 might be the actual server-side integration layer of the plugin, whereas subproject2 might be a webserver that is run separately outside of jenkins. Should those be in separate repositories? Again any advice, resources or suggestions would be greatly appreciated!
4 replies
JCHJava Community | Help. Code. Learn.
Created by DaMango on 10/26/2024 in #java-help
Preferences and Suggestions on when to use Java or Kotlin?
I am not trying to be controversial. Just thinking about writing a plugin for teamcity that seems to be able to use either. I think my work writes them with Kotlin and Gradle which I was leaning towards, but I can imagine Java has a more mature ecosystem. I haven’t used much of either, I’m not worried about my ability to learn, just want to know if there are situations where you might want to use one over the other. Is this custom plugin one of those situations?
5 replies