Skip to content

Commit

Permalink
Publish all artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
Matyrobbrt committed May 29, 2024
1 parent b8012a6 commit d71bb63
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 4 deletions.
36 changes: 36 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
import net.neoforged.gradleutils.PomUtilsExtension

import java.nio.file.Files

plugins {
id 'java'
id 'maven-publish'
id 'net.neoforged.gradleutils' version '3.0.0-alpha.13'
id 'com.github.johnrengelman.shadow' version '7.+'
}

group 'net.neoforged.camelot'
println("Version: ${version = gradleutils.version}")

gradleutils {
setupCentralPublishing()
setupSigning(signAllPublications: true)
}

tasks.register('run', JavaExec).configure {
classpath(sourceSets.main.runtimeClasspath)
mainClass.set('net.neoforged.camelot.BotMain')
Expand All @@ -27,6 +35,11 @@ tasks.register('run', JavaExec).configure {
java.toolchain.languageVersion = JavaLanguageVersion.of(21)
java.toolchain.vendor = JvmVendorSpec.GRAAL_VM

java {
withJavadocJar()
withSourcesJar()
}

repositories {
mavenCentral()
maven {
Expand All @@ -48,6 +61,12 @@ compileJava {
options.compilerArgs.add('--enable-preview')
}

javadoc {
final opt = options as CoreJavadocOptions
opt.addStringOption('-release', '21')
opt.addBooleanOption('-enable-preview', true)
}

evaluationDependsOn(':config')

dependencies {
Expand Down Expand Up @@ -130,5 +149,22 @@ tasks.register('outputVersion') {

shadowJar {
mergeServiceFiles()
archiveClassifier = 'all'
archiveFile.set(project.file("$buildDir/libs/camelot-all.jar"))
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifactId = 'camelot'
pom {
name = 'Camelot'
description = 'The Camelot Discord bot'
rootProject.pomUtils.githubRepo(it, 'Camelot')
rootProject.pomUtils.neoForgedDeveloper(it)
rootProject.pomUtils.license(it, PomUtilsExtension.License.MIT)
}
}
}
}
3 changes: 0 additions & 3 deletions config/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ group = rootProject.group
version = rootProject.version

rootProject.gradleutils {
setupCentralPublishing()
setupSigning(project: this.project, signAllPublications: true)
}

Expand All @@ -36,8 +35,6 @@ dependencies {
implementation group: 'org.kohsuke', name: 'github-api', version: project.ghapi_version
}

tasks.groovydoc

publishing {
publications {
mavenJava(MavenPublication) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package net.neoforged.camelot.script;

import java.util.List;

/**
* A specific exception thrown by {@link ScriptOptions#parse()} when parsing the arguments failed. <br>
* This allows {@link ScriptUtils#execute(ScriptContext, String, String)} to detect when an exception is argument
* This allows {@link ScriptUtils#execute(ScriptContext, String, List)} to detect when an exception is argument
* parsing failure (starts with the prefix {@value #PREFIX}) and report it as such (without a stacktrace).
*/
public final class CmdLineParseException extends Exception {
Expand Down

0 comments on commit d71bb63

Please sign in to comment.