-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial gradle build #212
base: main
Are you sure you want to change the base?
Initial gradle build #212
Conversation
e40279a
to
28c14a9
Compare
sdccc/build.gradle.kts
Outdated
|
||
val projectName = "SDCcc-gradle" | ||
|
||
launch4j { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider providing something we can reuse in other places instead of hardcoding it here - convention plugin? :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other places where?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sdccc-internal basically, having to repeat almost the same configuration there isn't great
Also remove the maven files ;) |
launch4j task (deprecated) changed to createExe
} | ||
|
||
tasks.withType<JavaCompile>() { | ||
options.release.set(javaVersion.toInt()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to documentation, setting this overrides sourceCompatibility
and targetCompatibility
for JavaCompile, but those were already set properly. Seems this one is redundant for now.
|
||
val detekt by configurations.creating | ||
|
||
val detektTask = tasks.register<JavaExec>("detekt") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this task into a kotlin-conventions plugin, just like the java-conventions, which we can reuse internally.
from(sourceSets["test"].output) | ||
} | ||
|
||
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this task into a kotlin-conventions plugin, just like the java-conventions, which we can reuse internally.
configFile = file("../checkstyle/checkstyle.xml") | ||
} | ||
|
||
spotless { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move configuration to java-conventions or better yet a separate java-analysis
plugin for reuse.
reports.create("xml") { required = true } | ||
} | ||
|
||
checkstyle { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move configuration to java-conventions or better yet a separate java-analysis
plugin for reuse.
testImplementation(project(":biceps-model")) | ||
testImplementation(project(":dpws-model")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider opting into the TYPESAFE_PROJECT_ACCESSORS
feature so that you can write
testImplementation(projects.bicepsModel)
testImplementation(projects.dpwsModel)
instead of having these awkward strings
tasks.createExe { | ||
headerType = "console" | ||
jar = "${layout.buildDirectory.get().asFile}/libs/${projectName}-${project.version}.jar" | ||
outfile = "${projectName}-${project.version}.exe" // Absolute path not allowed. File gets placed in build/launch4j |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is producing a SDCcc-gradle-unspecified.exe
, as project version isn't set for the sdccc module, only in the parent build.gradle.kts. Move setting the version to a convention plugin and apply them to the subprojects.
mainClassName = "com.draeger.medical.sdccc.TestSuite" | ||
classpath = mutableSetOf("lib/**") | ||
jreMinVersion = javaVersion | ||
bundledJrePath = "${layout.buildDirectory.get().asFile}/${jreFullPath}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jaxbClasspath = jaxb | ||
schemaLocation = layout.projectDirectory.dir(schemaDir) | ||
args = listOf( | ||
"-Xannotate", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This flag was also not enabled by our model previously. Now, it doesn't do anything, as we have no annotations in the .xjb file, but still.
testImplementation(libs.org.junit.jupiter.junit.jupiter.engine) | ||
|
||
jaxb(libs.org.jetbrains.annotations) | ||
jaxb(libs.org.jvnet.jaxb.jaxb.plugin.annotate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the same vein as the other remark in this file, we don't use the annotate plugin
jar = "${layout.buildDirectory.get().asFile}/libs/${projectName}-${project.version}.jar" | ||
outfile = "${projectName}-${project.version}.exe" // Absolute path not allowed. File gets placed in build/launch4j | ||
mainClassName = "com.draeger.medical.sdccc.TestSuite" | ||
classpath = mutableSetOf("lib/**") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be mutable?
// Initial migration to gradle
Checklist
The following aspects have been respected by the author of this pull request, confirmed by both pull request assignee and reviewer: