configure publishing

This commit is contained in:
Jason Penilla 2023-03-29 09:19:05 -07:00
parent e35a734744
commit df6b444946
No known key found for this signature in database
GPG Key ID: 0E75A301420E48F8

View File

@ -68,32 +68,20 @@ paperweight {
} }
} }
//
// Everything below here is optional if you don't care about publishing API or dev bundles to your repository
//
tasks.generateDevelopmentBundle { tasks.generateDevelopmentBundle {
apiCoordinates.set("dev.folia:folia-api") apiCoordinates.set("dev.folia:folia-api")
mojangApiCoordinates.set("io.papermc.paper:paper-mojangapi") mojangApiCoordinates.set("io.papermc.paper:paper-mojangapi")
libraryRepositories.set( libraryRepositories.addAll(
listOf( "https://repo.maven.apache.org/maven2/",
"https://repo.maven.apache.org/maven2/", paperMavenPublicUrl,
paperMavenPublicUrl,
// "https://my.repo/", // This should be a repo hosting your API (in this example, 'dev.folia:folia-api')
)
) )
} }
allprojects { allprojects {
// Publishing API:
// ./gradlew :folia-API:publish[ToMavenLocal]
publishing { publishing {
repositories { repositories {
maven { maven("https://repo.papermc.io/repository/maven-snapshots/") {
name = "myRepoSnapshots" name = "paperSnapshots"
url = uri("https://my.repo/")
// See Gradle docs for how to provide credentials to PasswordCredentials
// https://docs.gradle.org/current/samples/sample_publishing_credentials.html
credentials(PasswordCredentials::class) credentials(PasswordCredentials::class)
} }
} }
@ -101,8 +89,6 @@ allprojects {
} }
publishing { publishing {
// Publishing dev bundle:
// ./gradlew publishDevBundlePublicationTo(MavenLocal|MyRepoSnapshotsRepository) -PpublishDevBundle
if (project.hasProperty("publishDevBundle")) { if (project.hasProperty("publishDevBundle")) {
publications.create<MavenPublication>("devBundle") { publications.create<MavenPublication>("devBundle") {
artifact(tasks.generateDevelopmentBundle) { artifact(tasks.generateDevelopmentBundle) {
@ -112,7 +98,6 @@ publishing {
} }
} }
tasks.withType<RebuildGitPatches> { tasks.withType<RebuildGitPatches> {
filterPatches.set(false) filterPatches.set(false)
} }