diff --git a/dist/java/build.gradle b/dist/java/build.gradle index f803a447..8644483e 100644 --- a/dist/java/build.gradle +++ b/dist/java/build.gradle @@ -1,8 +1,10 @@ +import com.vanniktech.maven.publish.SonatypeHost + plugins { id 'java-library' - id 'maven-publish' id "com.vanniktech.maven.publish" version "0.29.0" id 'com.github.johnrengelman.shadow' version '8.1.1' + id 'com.google.osdetector' version '1.7.3' } group = 'mp.code' @@ -10,43 +12,8 @@ version = '0.0.1' java { sourceCompatibility = targetCompatibility = JavaVersion.VERSION_11 -} - -import com.vanniktech.maven.publish.SonatypeHost - -mavenPublishing { - //publishToMavenCentral(SonatypeHost.S01) // for snapshots - publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) // central repository - // publishToMavenCentral(SonatypeHost.DEFAULT) // default - - signAllPublications() - - coordinates(project.group, rootProject.name, project.version) - - pom { - name = rootProject.name - description = "A collaborative editor plugin ecosystem" - inceptionYear = "2022" - url = "https://code.mp/" - licenses { - license { - name = "The GNU General Public License v3.0" - url = "https://www.gnu.org/licenses/gpl-3.0.txt" - } - } - developers { - developer { - id = "zaaarf" - name = "zaaarf" - email = "zaaarf@codemp.dev" - } - } - scm { - url = "https://github.com/hexedtech/codemp/" - connection = "scm:git:git://github.com/hexedtech/codemp.git" - developerConnection = "scm:git:ssh://git@github.com/hexedtech/codemp.git" - } - } + withSourcesJar() + withJavadocJar() } repositories { @@ -65,7 +32,7 @@ dependencies { } shadowJar { - archiveClassifier.set('') + jar.archiveClassifier = archiveClassifier = osdetector.classifier dependencies { include(dependency('com.github.adamheinrich:native-utils:master-SNAPSHOT')) } @@ -95,3 +62,39 @@ tasks.register('cargoBuild', Exec) { processResources.dependsOn cargoBuild build.finalizedBy shadowJar + + +mavenPublishing { + //publishToMavenCentral(SonatypeHost.S01) // for snapshots + publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) // central repository + // publishToMavenCentral(SonatypeHost.DEFAULT) // default + + signAllPublications() + + coordinates(project.group, rootProject.name, project.version) + + pom { + name = rootProject.name + description = "A collaborative editor plugin ecosystem" + inceptionYear = "2022" + url = "https://code.mp/" + licenses { + license { + name = "The GNU General Public License v3.0" + url = "https://www.gnu.org/licenses/gpl-3.0.txt" + } + } + developers { + developer { + id = "zaaarf" + name = "zaaarf" + email = "zaaarf@codemp.dev" + } + } + scm { + url = "https://github.com/hexedtech/codemp/" + connection = "scm:git:git://github.com/hexedtech/codemp.git" + developerConnection = "scm:git:ssh://git@github.com/hexedtech/codemp.git" + } + } +} \ No newline at end of file