✨ Fix build scripts and prepare Maven publishing
This commit is contained in:
parent
9d47a7c82d
commit
a43c3e9145
3 changed files with 59 additions and 23 deletions
71
build.gradle
71
build.gradle
|
|
@ -14,6 +14,7 @@ plugins {
|
||||||
id 'com.github.hierynomus.license' version '0.15.0'
|
id 'com.github.hierynomus.license' version '0.15.0'
|
||||||
id 'java-library'
|
id 'java-library'
|
||||||
id 'com.github.johnrengelman.shadow' version '6.0.0'
|
id 'com.github.johnrengelman.shadow' version '6.0.0'
|
||||||
|
id 'maven-publish'
|
||||||
}
|
}
|
||||||
|
|
||||||
checkstyle {
|
checkstyle {
|
||||||
|
|
@ -28,6 +29,7 @@ allprojects {
|
||||||
|
|
||||||
group = 'cloud.commandframework'
|
group = 'cloud.commandframework'
|
||||||
version = '0.3.0-SNAPSHOT'
|
version = '0.3.0-SNAPSHOT'
|
||||||
|
description = 'Command framework and dispatcher for the JVM'
|
||||||
|
|
||||||
/* Disable checkstyle on tests */
|
/* Disable checkstyle on tests */
|
||||||
project.gradle.startParameter.excludedTaskNames.add('checkstyleTest')
|
project.gradle.startParameter.excludedTaskNames.add('checkstyleTest')
|
||||||
|
|
@ -49,11 +51,22 @@ subprojects {
|
||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'java-library'
|
apply plugin: 'java-library'
|
||||||
apply plugin: 'maven-publish'
|
apply plugin: 'maven-publish'
|
||||||
|
apply plugin: 'signing'
|
||||||
|
|
||||||
test {
|
test {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task publishingSourcesJar(type: Jar) {
|
||||||
|
from sourceSets.main.allJava
|
||||||
|
archiveClassifier.set('sources')
|
||||||
|
}
|
||||||
|
|
||||||
|
task publishingJavadocJar(type: Jar) {
|
||||||
|
from javadoc
|
||||||
|
archiveClassifier.set('javadoc')
|
||||||
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
|
@ -101,6 +114,7 @@ subprojects {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly 'org.checkerframework:checker-qual:3.5.0'
|
compileOnly 'org.checkerframework:checker-qual:3.5.0'
|
||||||
|
api 'io.leangen.geantyref:geantyref:0.3.4'
|
||||||
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
|
testImplementation 'org.junit.jupiter:junit-jupiter-engine:5.7.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -109,23 +123,54 @@ subprojects {
|
||||||
tasks.withType(JavaCompile) {
|
tasks.withType(JavaCompile) {
|
||||||
options.encoding = 'UTF-8'
|
options.encoding = 'UTF-8'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
maven(MavenPublication) {
|
||||||
|
from components.java
|
||||||
|
|
||||||
|
artifact publishingJavadocJar
|
||||||
|
artifact publishingSourcesJar
|
||||||
|
|
||||||
|
pom {
|
||||||
|
name = project.name
|
||||||
|
url = 'https://github.com/Sauilitired/cloud'
|
||||||
|
description = project.description
|
||||||
|
|
||||||
|
developers {
|
||||||
|
developer {
|
||||||
|
id = 'Sauilitired'
|
||||||
|
name = 'Alexander Söderberg'
|
||||||
|
url = 'https://alexander-soderberg.com'
|
||||||
|
email = 'contact@alexander-soderberg.com'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task aggregatedJavadocs(type: Javadoc, description: "Generate javadocs from all child projects as if it was a single project", group: "Documentation") {
|
issueManagement {
|
||||||
destinationDir = file("./docs/javadoc")
|
system = 'GitHub Issues'
|
||||||
title = "$project.name $version API"
|
url = 'https://github.com/Sauilitired/cloud/issues'
|
||||||
options.author true
|
}
|
||||||
options.links "http://docs.spring.io/spring/docs/4.3.x/javadoc-api/", "http://docs.oracle.com/javase/8/docs/api/", "http://docs.spring.io/spring-ws/docs/2.3.0.RELEASE/api/", "http://docs.spring.io/spring-security/site/docs/4.0.4.RELEASE/apidocs/"
|
|
||||||
options.addStringOption("Xdoclint:none", "-quiet")
|
|
||||||
|
|
||||||
delete("./docs")
|
licenses {
|
||||||
|
license {
|
||||||
|
name = 'MIT License'
|
||||||
|
url = 'https://opensource.org/licenses/MIT'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
subprojects.each { proj ->
|
scm {
|
||||||
proj.tasks.withType(Javadoc).each { javadocTask ->
|
connection = 'scm:git@github.com:Sauilitired/cloud.git'
|
||||||
source += javadocTask.source
|
developerConnection = 'scm:git@github.com:Sauilitired/cloud.git'
|
||||||
classpath += javadocTask.classpath
|
url = 'https://github.com/Sauilitired/cloud/'
|
||||||
excludes += javadocTask.excludes
|
|
||||||
includes += javadocTask.includes
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
signing {
|
||||||
|
required { project.hasProperty('signing.keyId') && gradle.taskGraph.hasTask(':publish') && !project.version.endsWith('-SNAPSHOT') }
|
||||||
|
sign publishing.publications.maven
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
dependencies {
|
|
||||||
api 'io.leangen.geantyref:geantyref:1.3.4'
|
|
||||||
}
|
|
||||||
|
|
@ -3,8 +3,6 @@ include(':cloud-jline')
|
||||||
include(':cloud-core')
|
include(':cloud-core')
|
||||||
include(':cloud-services')
|
include(':cloud-services')
|
||||||
include(':cloud-annotations')
|
include(':cloud-annotations')
|
||||||
include(':cloud-bukkit-test')
|
|
||||||
include(':cloud-velocity-test')
|
|
||||||
include(':cloud-bukkit')
|
include(':cloud-bukkit')
|
||||||
include(':cloud-paper')
|
include(':cloud-paper')
|
||||||
include(':cloud-brigadier')
|
include(':cloud-brigadier')
|
||||||
|
|
@ -12,9 +10,6 @@ include(':cloud-bungee')
|
||||||
include(':cloud-velocity')
|
include(':cloud-velocity')
|
||||||
include(':cloud-minecraft-extras')
|
include(':cloud-minecraft-extras')
|
||||||
include(':cloud-cloudburst')
|
include(':cloud-cloudburst')
|
||||||
include(':cloud-cloudburst-test')
|
|
||||||
project(':cloud-bukkit-test').projectDir = file('cloud-minecraft/cloud-bukkit-test')
|
|
||||||
project(':cloud-velocity-test').projectDir = file('cloud-minecraft/cloud-velocity-test')
|
|
||||||
project(':cloud-bukkit').projectDir = file('cloud-minecraft/cloud-bukkit')
|
project(':cloud-bukkit').projectDir = file('cloud-minecraft/cloud-bukkit')
|
||||||
project(':cloud-paper').projectDir = file('cloud-minecraft/cloud-paper')
|
project(':cloud-paper').projectDir = file('cloud-minecraft/cloud-paper')
|
||||||
project(':cloud-brigadier').projectDir = file('cloud-minecraft/cloud-brigadier')
|
project(':cloud-brigadier').projectDir = file('cloud-minecraft/cloud-brigadier')
|
||||||
|
|
@ -22,4 +17,3 @@ project(':cloud-bungee').projectDir = file('cloud-minecraft/cloud-bungee')
|
||||||
project(':cloud-velocity').projectDir = file('cloud-minecraft/cloud-velocity')
|
project(':cloud-velocity').projectDir = file('cloud-minecraft/cloud-velocity')
|
||||||
project(':cloud-minecraft-extras').projectDir = file('cloud-minecraft/cloud-minecraft-extras')
|
project(':cloud-minecraft-extras').projectDir = file('cloud-minecraft/cloud-minecraft-extras')
|
||||||
project(':cloud-cloudburst').projectDir = file('cloud-minecraft/cloud-cloudburst')
|
project(':cloud-cloudburst').projectDir = file('cloud-minecraft/cloud-cloudburst')
|
||||||
project(':cloud-cloudburst-test').projectDir = file('cloud-minecraft/cloud-cloudburst-test')
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue