Skip to content
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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Conversation

midttuna
Copy link
Contributor

@midttuna midttuna commented Oct 8, 2024

// 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:

  • Adherence to coding conventions
    • Pull Request Assignee
    • Reviewer
  • Adherence to javadoc conventions
    • Pull Request Assignee
    • Reviewer
  • Changelog update (necessity checked and entry added or not added respectively)
    • Pull Request Assignee
    • Reviewer
  • README update (necessity checked and entry added or not added respectively)
    • Pull Request Assignee
    • Reviewer
  • config update (necessity checked and entry added or not added respectively)
    • Pull Request Assignee
    • Reviewer
  • SDCcc executable ran against a test device (if necessary)
    • Pull Request Assignee
    • Reviewer

Comment on lines +27 to +29
org-junit-jupiter-junit-jupiter-api = "5.10.2"
org-junit-jupiter-junit-jupiter-engine = "5.10.2"
org-junit-jupiter-junit-jupiter-params = "5.10.2"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the intentions of having this file is not having to maintain separate versions where the version number is actually shared. Please consolidate duplicate versions into single entries where possible

@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a more recent version, at the time of writing 8.10.2 is the latest release

@@ -0,0 +1,12 @@
allprojects {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using allprojects/subprojects is considered bad practice by the gradle community and developers now and should be avoided. Move this to the java-conventions plugin

}

val jaxb: Configuration by configurations.creating
val jaxbVersion: String = "4.0.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused

val jaxb: Configuration by configurations.creating
val jaxbVersion: String = "4.0.0"
val schemaDir = "src/main"
val xjcOutputDir = "$buildDir/generated/source/xjc/main"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unused

// force generated javadoc to english
javaExec.jvmArgs = listOf("-Duser.language=en-US")

javaExec.args = mutableListOf(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This enables way more flags and plugins than we previously did, changing the data model somewhat. Should only happen in a separate PR if needed.

Comment on lines +66 to +67
val connection = url.openConnection()
connection.connect()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is using the default configuration of indefinite timeouts, which we very likely do not want.

}

dependencies {
implementation("com.github.jk1:gradle-license-report:2.0")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2.0 is over three years old, current release is 2.9

private fun downloadLicense(licenseUrl: String, moduleName: String, fileName: String) {
val sanitizedUrl = licenseUrl.trim()
val url = URL(sanitizedUrl)
val safeModuleName = moduleName.replace("[^a-zA-Z0-9.-]".toRegex(), "_")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unused


val projectName = "SDCcc-gradle"

launch4j {
Copy link
Member

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? :)

@ldeichmann
Copy link
Member

Also remove the maven files ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants