forked from cmatsuoka/libxmp-java
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
78 lines (64 loc) · 1.39 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
plugins {
id "java"
id "maven-publish"
}
import org.apache.tools.ant.taskdefs.condition.Os
apply plugin: "java"
apply from: "natives.gradle"
group = "org.helllabs"
version = "1.0.5"
ext.moduleName = "libxmp-java"
compileJava {
options.compilerArgs += ["-h", file("include")]
}
clean.doFirst {
delete fileTree("include") {
include "*.h"
}
}
task sourceJar(type: Jar) {
from sourceSets.main.allJava
}
tasks.withType(JavaCompile) {
sourceCompatibility = 17
}
publishing {
publications {
maven(MavenPublication) {
groupId rootProject.group
artifactId moduleName
version rootProject.version
from components.java
}
}
repositories {
maven {
name = "projectlounge"
url = "https://repo.projectlounge.pw/maven/releases"
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)
}
}
}
}
task compileNatives() {}
task checkNatives() {}
processResources {
dependsOn checkNatives
}
def buildTaskConfig = [
buildBase: buildDir,
projectBase: projectDir,
deployBase: projectDir,
compileTask: tasks.compileNatives,
checkTask: tasks.checkNatives,
name: 'xmp-jni'
]
createBuildTask(tasks, buildTaskConfig, System.getenv("TARGET_ARCH") ?: System.getProperty("os.arch"))
task deployAll() {
copy {
from "${projectDir}/dist"
into "${projectDir}/src/main/resources/natives"
}
}