Skip to content

Commit

Permalink
build(annotation-processor): Prepare Maven publication
Browse files Browse the repository at this point in the history
  • Loading branch information
Clashsoft committed Mar 4, 2024
1 parent 129388a commit 0ceab82
Showing 1 changed file with 51 additions and 8 deletions.
59 changes: 51 additions & 8 deletions annotation-processor/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
plugins {
id "java"
id 'maven-publish'
id 'signing'
}

group projectGroup
version projectVersion
group = projectGroup
version = project.findProperty('processorVersion') ?: getGitVersion()

String getGitVersion() {
String output = 'git describe --tags --always'.execute([], rootDir).text.trim()
if (output.startsWith('v')) {
output = output.substring(1)
}
return output
}

// ------------------- Dependencies -------------------

Expand Down Expand Up @@ -31,12 +41,8 @@ java {
sourceCompatibility = getVersionForMajor(javaSourceVersion)
targetCompatibility = getVersionForMajor(javaTargetVersion)

if (generateSourcesJar) {
withSourcesJar()
}
if (generateJavadocJar) {
withJavadocJar()
}
withSourcesJar()
withJavadocJar()
}

static JavaVersion getVersionForMajor(String version) {
Expand Down Expand Up @@ -65,3 +71,40 @@ jar {

duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}

// ------------------- Publishing -------------------

publishing.publications.create('mavenJava', MavenPublication) {
it.artifactId = 'fulibFx-processor'
it.from(components.java)
it.pom {
name = 'fulibFx-processor'
description = project.description
url = 'https://github.com/fujaba/fulibFx'
inceptionYear = '2023'

scm {
url = 'https://github.com/fujaba/fulibFx'
}

licenses {
license {
name = 'MIT License'
url = 'https://www.opensource.org/licenses/mit-license.php'
}
}

developers {
developer {
id = 'LeStegii'
name = 'Paul Mertens'
}
developer {
id = 'Clashsoft'
name = 'Adrian Kunz'
}
}
}
}

signing.sign publishing.publications.mavenJava

0 comments on commit 0ceab82

Please sign in to comment.