codemp/dist/java/build.gradle

109 lines
2.3 KiB
Groovy
Raw Normal View History

plugins {
2024-08-08 00:29:54 +02:00
id 'java-library'
id 'maven-publish'
2024-09-18 02:40:55 +02:00
id 'signing'
id 'com.github.johnrengelman.shadow' version '8.1.1'
}
group = 'mp.code'
2024-09-18 02:40:55 +02:00
version = '0.0.1-SNAPSHOT'
2024-08-08 00:29:54 +02:00
java {
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
}
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
sourceSets {
main.java.srcDirs = ['src/']
}
dependencies {
implementation 'com.github.adamheinrich:native-utils:master-SNAPSHOT'
compileOnly 'org.projectlombok:lombok:1.18.34'
annotationProcessor 'org.projectlombok:lombok:1.18.34'
}
shadowJar {
archiveClassifier.set('')
dependencies {
include(dependency('com.github.adamheinrich:native-utils:master-SNAPSHOT'))
}
}
def rustDir = projectDir.toPath()
2024-08-08 00:29:54 +02:00
.parent
.parent
.resolve('target')
.resolve('release')
.toFile()
processResources {
outputs.upToDateWhen { false } // no caching
from(rustDir) {
include('*.dll')
include('*.so')
2024-09-09 20:59:07 +02:00
include('*dylib')
into('natives/')
}
}
tasks.register('cargoBuild', Exec) {
workingDir '.'
commandLine 'cargo', 'build', '--release', '--features=java'
}
processResources.dependsOn cargoBuild
2024-09-09 16:06:05 +02:00
build.finalizedBy shadowJar
publishing {
publications {
mavenJava(MavenPublication) {
2024-09-18 02:40:55 +02:00
artifactId = rootProject.name
version = project.version
from components.java
pom {
2024-09-18 02:40:55 +02:00
name = 'codemp'
description = 'A collaborative editor plugin ecosystem'
url = 'https://code.mp'
licenses {
license {
2024-09-18 02:40:55 +02:00
name = 'The GNU General Public License v3.0'
url = 'https://www.gnu.org/licenses/gpl-3.0.txt'
}
}
developers {
developer {
2024-09-18 02:40:55 +02:00
id = 'zaaarf'
email = 'zaaarf@codemp.dev'
}
}
scm {
2024-09-18 02:40:55 +02:00
connection = 'scm:git:git://github.com/hexedtech/codemp.git'
developerConnection = 'scm:git:ssh://github.com/hexedtech/codemp.git'
url = 'https://github.com/hexedtech/codemp/'
}
}
}
}
2024-09-18 02:40:55 +02:00
repositories {
maven {
name = "centralManualTesting"
url "https://central.sonatype.com/api/v1/publisher/deployments/download/"
credentials {
username = System.getenv('MAVEN_CENTRAL_USERNAME')
password = System.getenv('MAVEN_CENTRAL_PASSWORD')
}
}
mavenCentral()
}
}
2024-09-18 02:40:55 +02:00
signing {
def signingKey = System.getenv('MAVEN_CENTRAL_GPG_SECRET_KEY')
def signingPassword = System.getenv('MAVEN_CENTRAL_GPG_PASSWORD')
useInMemoryPgpKeys(signingKey, signingPassword)
sign publishing.publications.mavenJava
}