codemp/dist/java/build.gradle
frelodev 6a8fb38930
Some checks failed
test / build (java, macos-latest, beta) (push) Has been cancelled
test / build (java, macos-latest, nightly) (push) Has been cancelled
test / build (java, macos-latest, stable) (push) Has been cancelled
test / build (java, ubuntu-latest, beta) (push) Has been cancelled
test / build (java, ubuntu-latest, nightly) (push) Has been cancelled
test / build (java, ubuntu-latest, stable) (push) Has been cancelled
test / build (java, windows-latest, beta) (push) Has been cancelled
test / build (java, windows-latest, nightly) (push) Has been cancelled
test / build (java, windows-latest, stable) (push) Has been cancelled
test / build (js, macos-latest, beta) (push) Has been cancelled
test / build (js, macos-latest, nightly) (push) Has been cancelled
test / build (js, macos-latest, stable) (push) Has been cancelled
test / build (js, ubuntu-latest, beta) (push) Has been cancelled
test / build (js, ubuntu-latest, nightly) (push) Has been cancelled
test / build (js, ubuntu-latest, stable) (push) Has been cancelled
test / build (js, windows-latest, beta) (push) Has been cancelled
test / build (js, windows-latest, nightly) (push) Has been cancelled
test / build (js, windows-latest, stable) (push) Has been cancelled
test / build (lua54, macos-latest, beta) (push) Has been cancelled
test / build (lua54, macos-latest, nightly) (push) Has been cancelled
test / build (lua54, macos-latest, stable) (push) Has been cancelled
test / build (lua54, ubuntu-latest, beta) (push) Has been cancelled
test / build (lua54, ubuntu-latest, nightly) (push) Has been cancelled
test / build (lua54, ubuntu-latest, stable) (push) Has been cancelled
test / build (lua54, windows-latest, beta) (push) Has been cancelled
test / build (lua54, windows-latest, nightly) (push) Has been cancelled
test / build (lua54, windows-latest, stable) (push) Has been cancelled
test / build (luajit, macos-latest, beta) (push) Has been cancelled
test / build (luajit, macos-latest, nightly) (push) Has been cancelled
test / build (luajit, macos-latest, stable) (push) Has been cancelled
test / build (luajit, ubuntu-latest, beta) (push) Has been cancelled
test / build (luajit, ubuntu-latest, nightly) (push) Has been cancelled
test / build (luajit, ubuntu-latest, stable) (push) Has been cancelled
test / build (luajit, windows-latest, beta) (push) Has been cancelled
test / build (luajit, windows-latest, nightly) (push) Has been cancelled
test / build (luajit, windows-latest, stable) (push) Has been cancelled
test / build (py, macos-latest, beta) (push) Has been cancelled
test / build (py, macos-latest, nightly) (push) Has been cancelled
test / build (py, macos-latest, stable) (push) Has been cancelled
test / build (py, ubuntu-latest, beta) (push) Has been cancelled
test / build (py, ubuntu-latest, nightly) (push) Has been cancelled
test / build (py, ubuntu-latest, stable) (push) Has been cancelled
java / build (map[filename:libcodemp.so runner:ubuntu-latest target:linux-x64-gnu]) (push) Has been cancelled
java / publish (push) Has been cancelled
javascript / build (map[runner:macos-14 target:darwin-arm64]) (push) Has been cancelled
javascript / build (map[runner:ubuntu-latest target:linux-x64-gnu]) (push) Has been cancelled
javascript / build (map[runner:windows-latest target:win32-x64]) (push) Has been cancelled
javascript / publish (push) Has been cancelled
lua / build (map[arch:aarch64 ext:dylib pre:lib runner:macos-latest target:darwin]) (push) Has been cancelled
lua / build (map[arch:x86_64 ext:dll pre:<nil> runner:windows-latest target:windows-msvc]) (push) Has been cancelled
lua / build (map[arch:x86_64 ext:so pre:lib runner:ubuntu-latest target:linux-gnu]) (push) Has been cancelled
lua / publish (push) Has been cancelled
test / build (py, windows-latest, beta) (push) Has been cancelled
test / build (py, windows-latest, nightly) (push) Has been cancelled
test / build (py, windows-latest, stable) (push) Has been cancelled
test / test (beta) (push) Has been cancelled
test / test (nightly) (push) Has been cancelled
test / test (stable) (push) Has been cancelled
java / build (map[filename:codemp.dll runner:windows-latest target:win32-x64]) (push) Has been cancelled
python / release (push) Has been cancelled
java / build (map[filename:libcodemp.dylib runner:macos-14 target:darwin-arm64]) (push) Has been cancelled
lua / upload (push) Has been cancelled
python / linux (map[runner:ubuntu-latest target:x86_64]) (push) Has been cancelled
python / windows (map[runner:windows-latest target:x64], map[features:py python:3.x]) (push) Has been cancelled
python / windows (map[runner:windows-latest target:x64], map[features:py-noabi python:3.8]) (push) Has been cancelled
python / macos (map[runner:macos-14 target:aarch64]) (push) Has been cancelled
python / sdist (push) Has been cancelled
rust / publish (push) Has been cancelled
release: v0.8.1 (#57)
release: v0.8.1
2024-10-20 18:33:36 +02:00

185 lines
3.8 KiB
Groovy

plugins {
id 'java-library'
id "com.vanniktech.maven.publish.base" version "0.30.0"
id 'com.google.osdetector' version '1.7.3'
}
group = 'mp.code'
version = '0.8.1'
tasks.register('windowsJar', Jar) {
outputs.upToDateWhen { false }
archiveClassifier = 'windows-x86_64'
from sourceSets.main.runtimeClasspath
from('artifacts') {
include('*.dll')
into('natives/')
}
doFirst {
if(!(new File('artifacts/codemp.dll').exists())) {
throw new GradleException("The required file does not exist!")
}
}
}
tasks.register('macosJar', Jar) {
outputs.upToDateWhen { false }
archiveClassifier = 'osx-aarch_64'
from sourceSets.main.runtimeClasspath
from('artifacts') {
include('*.dylib')
into('natives/')
}
doFirst {
if(!(new File('artifacts/libcodemp.dylib').exists())) {
throw new GradleException("The required file does not exist!")
}
}
}
tasks.register('linuxJar', Jar) {
outputs.upToDateWhen { false }
archiveClassifier = 'linux-x86_64'
from sourceSets.main.runtimeClasspath
from('artifacts') {
include('*.so')
into('natives/')
}
doFirst {
if(!(new File('artifacts/libcodemp.so').exists())) {
throw new GradleException("The required file does not exist! Maybe you need to `cargo build` the main library first?")
}
}
}
tasks.register('multiplatformJar', Jar) {
outputs.upToDateWhen { false }
archiveClassifier = 'all'
from sourceSets.main.runtimeClasspath
from('artifacts') {
include('*')
into('natives/')
}
}
configurations {
windowsJar {
canBeConsumed = true
canBeResolved = false
extendsFrom implementation, runtimeOnly
}
linuxJar {
canBeConsumed = true
canBeResolved = false
extendsFrom implementation, runtimeOnly
}
macosJar {
canBeConsumed = true
canBeResolved = false
extendsFrom implementation, runtimeOnly
}
multiplatformJar {
canBeConsumed = true
canBeResolved = false
extendsFrom implementation, runtimeOnly
}
}
java {
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_11
withSourcesJar()
withJavadocJar()
}
artifacts {
archives jar
archives sourcesJar
archives javadocJar
windowsJar(windowsJar)
macosJar(macosJar)
linuxJar(linuxJar)
multiplatformJar(multiplatformJar)
}
repositories {
mavenCentral()
}
sourceSets {
main.java.srcDirs = ['src/']
}
dependencies {
compileOnly 'org.projectlombok:lombok:1.18.34'
annotationProcessor 'org.projectlombok:lombok:1.18.34'
}
tasks.register('cargoBuild', Exec) {
workingDir '.'
commandLine 'cargo', 'build', '--release', '--features=java'
}
def rustDir = projectDir.toPath()
.parent
.parent
.resolve('target')
.resolve('release')
.toFile()
tasks.register('nativeBuild', Jar) {
archiveClassifier = osdetector.classifier
dependsOn cargoBuild
from sourceSets.main.runtimeClasspath
from(rustDir) {
include('*.dll')
include('*.so')
include('*dylib')
into('natives/')
}
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
artifact sourcesJar
artifact javadocJar
artifact windowsJar
artifact linuxJar
artifact macosJar
artifact multiplatformJar
}
}
}
import com.vanniktech.maven.publish.SonatypeHost
mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true)
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"
}
}
}