Switch to using maven-publish

The old maven package is removed in Gradle 7.0. Instead, we publish to
squiddev.cc using WebDAV (ewww).
This commit is contained in:
Jonathan Coates 2021-04-24 11:26:04 +01:00
parent 003c7ec2e8
commit 92b45b1868
1 changed files with 35 additions and 52 deletions

View File

@ -17,6 +17,7 @@
plugins {
id "checkstyle"
id "jacoco"
id "maven-publish"
id "com.github.hierynomus.license" version "0.15.0"
id "com.matthewprenger.cursegradle" version "1.4.0"
id "com.github.breadmoirai.github-release" version "2.2.12"
@ -24,8 +25,6 @@
}
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'maven-publish'
apply plugin: 'maven'
version = mod_version
@ -36,6 +35,9 @@
toolchain {
languageVersion = JavaLanguageVersion.of(8)
}
withSourcesJar()
withJavadocJar()
}
minecraft {
@ -112,7 +114,6 @@ accessTransformer file('src/main/resources/META-INF/accesstransformer.cfg')
configurations {
shade
compile.extendsFrom shade
deployerJars
cctJavadoc
}
@ -139,8 +140,6 @@ accessTransformer file('src/main/resources/META-INF/accesstransformer.cfg')
testImplementation 'org.jetbrains.kotlin:kotlin-reflect:1.3.72'
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.8'
deployerJars "org.apache.maven.wagon:wagon-ssh:3.0.0"
cctJavadoc 'cc.tweaked:cct-javadoc:1.3.0'
}
@ -168,8 +167,6 @@ task luaJavadoc(type: Javadoc) {
}
jar {
dependsOn javadoc
manifest {
attributes(["Specification-Title": "computercraft",
"Specification-Vendor": "SquidDev",
@ -180,10 +177,6 @@ task luaJavadoc(type: Javadoc) {
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")])
}
from (sourceSets.main.allSource) {
include "dan200/computercraft/api/**/*.java"
}
from configurations.shade.collect { it.isDirectory() ? it : zipTree(it) }
}
@ -550,51 +543,41 @@ task setupServer(type: Copy) {
publishing {
publications {
mavenJava(MavenPublication) {
maven(MavenPublication) {
from components.java
// artifact sourceJar
pom {
name = 'CC: Tweaked'
description = 'CC: Tweaked is a fork of ComputerCraft, adding programmable computers, turtles and more to Minecraft.'
url = 'https://github.com/SquidDev-CC/CC-Tweaked'
scm {
url = 'https://github.com/SquidDev-CC/CC-Tweaked.git'
}
issueManagement {
system = 'github'
url = 'https://github.com/SquidDev-CC/CC-Tweaked/issues'
}
licenses {
license {
name = 'ComputerCraft Public License, Version 1.0'
url = 'https://github.com/SquidDev-CC/CC-Tweaked/blob/mc-1.15.x/LICENSE'
}
}
}
}
}
}
uploadArchives {
repositories {
if(project.hasProperty('mavenUploadUrl')) {
mavenDeployer {
configuration = configurations.deployerJars
repository(url: project.property('mavenUploadUrl')) {
authentication(
userName: project.property('mavenUploadUser'),
privateKey: project.property('mavenUploadKey'))
}
pom.project {
name 'CC: Tweaked'
packaging 'jar'
description 'CC: Tweaked is a fork of ComputerCraft, adding programmable computers, turtles and more to Minecraft.'
url 'https://github.com/SquidDev-CC/CC-Tweaked'
scm {
url 'https://github.com/SquidDev-CC/CC-Tweaked.git'
}
issueManagement {
system 'github'
url 'https://github.com/SquidDev-CC/CC-Tweaked/issues'
}
licenses {
license {
name 'ComputerCraft Public License, Version 1.0'
url 'https://github.com/SquidDev-CC/CC-Tweaked/blob/master/LICENSE'
distribution 'repo'
}
}
}
pom.whenConfigured { pom ->
pom.dependencies.clear()
if (project.hasProperty("mavenUser")) {
maven {
name = "SquidDev"
url = "https://squiddev.cc/maven"
credentials {
username = project.property("mavenUser") as String
password = project.property("mavenPass") as String
}
}
}
@ -625,7 +608,7 @@ task setupServer(type: Copy) {
prerelease false
}
def uploadTasks = ["uploadArchives", "curseforge", "githubRelease"]
def uploadTasks = ["publish", "curseforge", "githubRelease"]
uploadTasks.forEach { tasks.getByName(it).dependsOn checkRelease }
task uploadAll(dependsOn: uploadTasks) {