Skip to content

Commit

Permalink
Centralize short name calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Vampire committed Apr 5, 2018
1 parent 3ccb30a commit 8ee37e9
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ clean {
}

subprojects {
description = "A multithreaded but easy to use Discord Java API (${name - ~/^javacord-/})"
ext.shortName = name - ~/^javacord-/
description = "A multithreaded but easy to use Discord Java API ($shortName)"
}

tasks.remove knows
Expand Down
11 changes: 2 additions & 9 deletions gradle/java9.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,10 @@ if (JavaVersion.current().java9Compatible) {
logger.warn 'Building on Java 8, resulting JARs will not be Jigsaw ready properly!'
}
}
project(':javacord-api') {
jar {
manifest {
attributes 'Automatic-Module-Name': 'org.javacord.api'
}
}
}
project(':javacord-core') {
subprojects {
jar {
manifest {
attributes 'Automatic-Module-Name': 'org.javacord.core'
attributes 'Automatic-Module-Name': "org.javacord.$shortName"
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions gradle/javadoc.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import javax.naming.ConfigurationException
import static org.gradle.api.JavaVersion.toVersion

allprojects {
subprojects {
tasks.withType(Javadoc) { javadocTask ->
def java9ToolChain = toVersion(toolChain.version).java9Compatible
// use taskGraph.whenReady to not always have a custom action which makes the task uncachable
Expand All @@ -22,7 +22,7 @@ allprojects {
options {
locale 'en'
encoding 'UTF-8'
docTitle "Javacord $project.version (${project.name - ~/^javacord-/})"
docTitle "Javacord $project.version ($project.shortName)"
windowTitle "$docTitle Documentation"
links 'https://docs.oracle.com/javase/8/docs/api/'
delegate.use()
Expand Down
6 changes: 1 addition & 5 deletions gradle/pom.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@ allprojects { project ->
apply plugin: 'me.tatarka.gradle.pom'

pom {
if (project.name =~ ~/^javacord-/) {
name "Javacord (${project.name - ~/^javacord-/})"
} else {
name 'Javacord'
}
name rootProject.name.capitalize() + (project.parent ? " ($shortName)" : '')
description project.description
url 'https://github.com/BtoBastian/Javacord/wiki'
issueManagement {
Expand Down

0 comments on commit 8ee37e9

Please sign in to comment.