forked from CadixDev/at
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Gradle, remove old publishing details, start Architectury setup
- Loading branch information
Showing
8 changed files
with
237 additions
and
236 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { | ||
|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.