Skip to content

Commit

Permalink
Update Gradle, remove old publishing details, start Architectury setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Juuxel committed Dec 15, 2023
1 parent c2b92fc commit 28d0610
Show file tree
Hide file tree
Showing 8 changed files with 237 additions and 236 deletions.
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

94 changes: 11 additions & 83 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
plugins {
`java-library`
signing
`maven-publish`
id("net.minecrell.licenser") version "0.4.1"
id("net.kyori.indra.licenser.spotless") version "3.1.3"
}

val baseVersion: String by project
version = baseVersion + "." + (System.getenv("GITHUB_RUN_NUMBER") ?: "9999")

logger.lifecycle(":building at v${version}")

java {
sourceCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
withJavadocJar()
}

repositories {
Expand All @@ -25,93 +31,15 @@ tasks.withType<Test> {
useJUnitPlatform()
}

val sourceJar = task<Jar>("sourceJar") {
classifier = "sources"
from(sourceSets["main"].allSource)
}

val javadocJar = task<Jar>("javadocJar") {
classifier = "javadoc"
from(tasks["javadoc"])
}

artifacts {
add("archives", sourceJar)
add("archives", javadocJar)
indraSpotlessLicenser {
licenseHeaderFile("LICENSE")
newLine(true)
}

val isSnapshot = version.toString().endsWith("-SNAPSHOT")

publishing {
publications {
register<MavenPublication>("mavenJava") {
from(components["java"])

artifact(sourceJar)
artifact(javadocJar)

pom {
val name: String by project
val description: String by project
val url: String by project
name(name)
description(description)
url(url)

scm {
url(url)
connection("scm:git:$url.git")
developerConnection.set(connection)
}

issueManagement {
system("GitHub Issues")
url("$url/issues")
}

licenses {
license {
name("MIT License")
url("https://opensource.org/licenses/MIT")
distribution("repo")
}
}

developers {
developer {
id("jamierocks")
name("Jamie Mansfield")
email("[email protected]")
url("https://www.jamiemansfield.me/")
timezone("Europe/London")
}
}
}
}
}

repositories {
val sonatypeUsername: String? by project
val sonatypePassword: String? by project
if (sonatypeUsername != null && sonatypePassword != null) {
val url = if (isSnapshot) "https://oss.sonatype.org/content/repositories/snapshots/"
else "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
maven(url) {
credentials {
username = sonatypeUsername
password = sonatypePassword
}
}
}
}
}

signing {
sign(publishing.publications["mavenJava"])
}

tasks.withType<Sign> {
onlyIf { !isSnapshot }
}

operator fun Property<String>.invoke(v: String) = set(v)
5 changes: 2 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
group = org.cadixdev
group = dev.architectury
name = at
version = 0.1.0-SNAPSHOT
baseVersion = 0.1
description = A representation of access modifier transformers for Java.
url = https://github.com/CadixDev/at
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 28d0610

Please sign in to comment.