2024-08-07 10:22:01 +02:00
|
|
|
plugins {
|
2024-08-08 00:29:54 +02:00
|
|
|
id 'java-library'
|
2024-08-07 10:22:01 +02:00
|
|
|
id 'maven-publish'
|
2024-09-18 04:09:51 +02:00
|
|
|
id "com.vanniktech.maven.publish" version "0.29.0"
|
2024-08-07 10:22:01 +02:00
|
|
|
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
|
|
|
|
}
|
2024-08-07 10:22:01 +02:00
|
|
|
|
2024-09-18 04:09:51 +02:00
|
|
|
import com.vanniktech.maven.publish.SonatypeHost
|
|
|
|
|
|
|
|
mavenPublishing {
|
2024-09-18 04:20:40 +02:00
|
|
|
publishToMavenCentral(SonatypeHost.S01) // for snapshots
|
|
|
|
// publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL) // central repository
|
|
|
|
// publishToMavenCentral(SonatypeHost.DEFAULT) // ????
|
2024-09-18 04:09:51 +02:00
|
|
|
|
|
|
|
signAllPublications()
|
|
|
|
|
|
|
|
coordinates("mp.code", "codemp", "0.0.1-SNAPSHOT")
|
|
|
|
|
|
|
|
pom {
|
|
|
|
name = "codemp"
|
|
|
|
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"
|
|
|
|
distribution = "https://www.gnu.org/licenses/gpl-3.0.txt"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
developers {
|
|
|
|
developer {
|
|
|
|
id = "zaaarf"
|
|
|
|
name = "zaaarf"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
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"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-08-07 10:22:01 +02:00
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
maven { url 'https://jitpack.io' }
|
|
|
|
}
|
|
|
|
|
|
|
|
sourceSets {
|
|
|
|
main.java.srcDirs = ['src/']
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation 'com.github.adamheinrich:native-utils:master-SNAPSHOT'
|
2024-09-17 17:37:22 +02:00
|
|
|
compileOnly 'org.projectlombok:lombok:1.18.34'
|
|
|
|
annotationProcessor 'org.projectlombok:lombok:1.18.34'
|
2024-08-07 10:22:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
2024-08-07 10:22:01 +02:00
|
|
|
.parent
|
|
|
|
.resolve('target')
|
|
|
|
.resolve('release')
|
|
|
|
.toFile()
|
2024-09-18 04:09:51 +02:00
|
|
|
|
2024-08-07 10:22:01 +02:00
|
|
|
processResources {
|
2024-09-15 20:38:47 +02:00
|
|
|
outputs.upToDateWhen { false } // no caching
|
2024-08-07 10:22:01 +02:00
|
|
|
from(rustDir) {
|
|
|
|
include('*.dll')
|
|
|
|
include('*.so')
|
2024-09-09 20:59:07 +02:00
|
|
|
include('*dylib')
|
2024-08-07 10:22:01 +02:00
|
|
|
into('natives/')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register('cargoBuild', Exec) {
|
|
|
|
workingDir '.'
|
|
|
|
commandLine 'cargo', 'build', '--release', '--features=java'
|
|
|
|
}
|
|
|
|
|
2024-09-15 20:38:47 +02:00
|
|
|
processResources.dependsOn cargoBuild
|
2024-09-09 16:06:05 +02:00
|
|
|
build.finalizedBy shadowJar
|