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'
|
|
|
|
id 'com.github.johnrengelman.shadow' version '8.1.1'
|
|
|
|
id 'com.palantir.git-version' version '3.1.0'
|
|
|
|
}
|
|
|
|
|
|
|
|
group = 'mp.code'
|
2024-08-08 00:29:54 +02:00
|
|
|
version = versionDetails().lastTag.substring(1)
|
|
|
|
|
|
|
|
java {
|
|
|
|
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
|
|
|
|
}
|
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'
|
|
|
|
}
|
|
|
|
|
|
|
|
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()
|
|
|
|
processResources {
|
|
|
|
from(rustDir) {
|
|
|
|
include('*.dll')
|
|
|
|
include('*.so')
|
|
|
|
into('natives/')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.register('cargoBuild', Exec) {
|
|
|
|
workingDir '.'
|
|
|
|
commandLine 'cargo', 'build', '--release', '--features=java'
|
|
|
|
}
|
|
|
|
|
|
|
|
build.dependsOn cargoBuild
|