Skip to content

Commit

Permalink
Update developer information
Browse files Browse the repository at this point in the history
  • Loading branch information
squid233 committed Nov 19, 2023
1 parent ced902b commit 0894b91
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
This is an example project.

You can change the options in gradle.properties and build.gradle.kts.

You can use this template by clicking "Use this template" or download ZIP.
29 changes: 24 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,20 @@ val publicationRepo: PublicationRepo? = if (hasPublication.toBoolean()) Publicat
releaseRepo = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
) else null

data class Organization(
val name: String,
val url: String
)

data class Developer(
val id: String,
val name: String? = null,
val email: String? = null
val email: String? = null,
val url: String? = null,
val organization: Organization? = projOrg,
val roles: Set<String>? = null,
val timezone: String? = null,
val properties: Map<String, String?>? = null
)

val projDevelopers = arrayOf(
Expand All @@ -51,6 +61,7 @@ val projLicenseFileName: String by rootProject

val orgName: String by rootProject
val orgUrl: String by rootProject
val projOrg = Organization(orgName, orgUrl)

val jdkVersion: String by rootProject
val jdkEnablePreview: String by rootProject
Expand Down Expand Up @@ -124,10 +135,10 @@ tasks.named<Jar>("jar") {
setMetadataCharset("utf-8")
manifest.attributes(
"Specification-Title" to projName,
"Specification-Vendor" to orgName,
"Specification-Vendor" to projOrg.name,
"Specification-Version" to projVersion,
"Implementation-Title" to projName,
"Implementation-Vendor" to orgName,
"Implementation-Vendor" to projOrg.name,
"Implementation-Version" to projVersion
//"Main-Class" to "org.example.Main"
)
Expand Down Expand Up @@ -174,15 +185,23 @@ if (hasPublication.toBoolean() && publicationRepo != null) {
}
}
organization {
name = orgName
url = orgUrl
name = projOrg.name
url = projOrg.url
}
developers {
projDevelopers.forEach {
developer {
id = it.id
it.name?.also { name = it }
it.email?.also { email = it }
it.url?.also { url = it }
it.organization?.also {
organization = it.name
organizationUrl = it.url
}
it.roles?.also { roles = it }
it.timezone?.also { timezone = it }
it.properties?.also { properties = it }
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ projVersion=0.1.0-SNAPSHOT
projDesc=An example project.
# Uncomment them if you want to publish to maven repository.
#projUrl=https://github.com/Over-Run/project-template
#projLicenseUrl=https://raw.githubusercontent.com/Over-Run/project-template/LICENSE
#projLicenseUrl=https://raw.githubusercontent.com/Over-Run/project-template/main/LICENSE
#projScmConnection=scm:git:https://github.com/Over-Run/project-template.git
#projScmUrl=https://github.com/Over-Run/project-template.git
projLicense=CC0-1.0
Expand Down

0 comments on commit 0894b91

Please sign in to comment.